Class: Aikido::Zen::Collector::SinkStats::CompressedTiming Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/aikido/zen/collector/sink_stats.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#compressed_atObject

Returns the value of attribute compressed_at

Returns:

  • (Object)

    the current value of compressed_at



85
86
87
# File 'lib/aikido/zen/collector/sink_stats.rb', line 85

def compressed_at
  @compressed_at
end

#meanObject

Returns the value of attribute mean

Returns:

  • (Object)

    the current value of mean



85
86
87
# File 'lib/aikido/zen/collector/sink_stats.rb', line 85

def mean
  @mean
end

#percentilesObject

Returns the value of attribute percentiles

Returns:

  • (Object)

    the current value of percentiles



85
86
87
# File 'lib/aikido/zen/collector/sink_stats.rb', line 85

def percentiles
  @percentiles
end

Instance Method Details

#as_jsonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



86
87
88
89
90
91
92
# File 'lib/aikido/zen/collector/sink_stats.rb', line 86

def as_json
  {
    averageInMs: mean * 1000,
    percentiles: percentiles.transform_values { |t| t * 1000 },
    compressedAt: compressed_at.to_i * 1000
  }
end