Class: Tracebin::SystemHealthSample

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

Constant Summary collapse

DATA_TYPE =
'system_health_sample'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SystemHealthSample

Returns a new instance of SystemHealthSample.



5
6
7
8
9
# File 'lib/tracebin/system_health_sample.rb', line 5

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

Instance Method Details

#payloadObject



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

def payload
  {
    type: DATA_TYPE,

    data: {
      sampled_at: @sampled_at,

      metrics: @metrics
    }
  }
end