Module: Instana::Collector

Defined in:
lib/instana/collectors.rb,
lib/instana/collectors/gc.rb,
lib/instana/collectors/memory.rb,
lib/instana/collectors/thread.rb

Defined Under Namespace

Classes: GC, Memory, Thread

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.intervalObject

Returns the value of attribute interval.



9
10
11
# File 'lib/instana/collectors.rb', line 9

def interval
  @interval
end

.snapshotObject

Returns the value of attribute snapshot.



10
11
12
# File 'lib/instana/collectors.rb', line 10

def snapshot
  @snapshot
end

Class Method Details

.collect_and_reportObject

collect_and_report

Run through each collector, let them collect up data and then report what we have via the agent



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/instana/collectors.rb', line 18

def collect_and_report
  payload = {}

  ::Instana.collectors.each do |c|
    metrics = c.collect
    if metrics
      payload[c.payload_key] = metrics
    else
      payload.delete(c.payload_key)
    end
  end

  # Report all the collected goodies
  ::Instana.agent.report_entity_data(payload) unless ENV['INSTANA_GEM_TEST']
end