Class: Tracebin::SystemHealthSample

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/tracebin/system_health_sample.rb

Constant Summary collapse

DATA_TYPE =
'system_health_sample'.freeze

Instance Method Summary collapse

Methods included from Helpers

#deserialize_time_string, #milliseconds_between, #time_to_string, #timestamp_string, #to_milliseconds

Constructor Details

#initialize(options = {}) ⇒ SystemHealthSample

Returns a new instance of SystemHealthSample.



7
8
9
10
11
# File 'lib/tracebin/system_health_sample.rb', line 7

def initialize(options = {})
  @process = options[:process] || :web
  @sampled_at = timestamp_string
  @metrics = sample_metrics
end

Instance Method Details

#payloadObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tracebin/system_health_sample.rb', line 13

def payload
  {
    type: DATA_TYPE,

    data: {
      sampled_at: @sampled_at,

      metrics: @metrics
    }
  }
end