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

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

Overview

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.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#compressed_atObject

Returns the value of attribute compressed_at

Returns:

  • the current value of compressed_at



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

def compressed_at
  @compressed_at
end

#meanObject

Returns the value of attribute mean

Returns:

  • the current value of mean



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

def mean
  @mean
end

#percentilesObject

Returns the value of attribute percentiles

Returns:

  • the current value of percentiles



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

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.

API:

  • private



90
91
92
93
94
95
96
# File 'lib/aikido/zen/collector/sink_stats.rb', line 90

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