Class: NewRelic::Security::Agent::Control::EventStats

Inherits:
Object
  • Object
show all
Defined in:
lib/newrelic_security/agent/control/event_stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEventStats

Returns a new instance of EventStats.



8
9
10
11
12
13
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 8

def initialize
  @processed = NewRelic::Security::Agent::Control::EventCounter.new
  @sent = NewRelic::Security::Agent::Control::EventCounter.new
  @rejected = NewRelic::Security::Agent::Control::EventCounter.new
  @error_count = NewRelic::Security::Agent::Control::EventCounter.new
end

Instance Attribute Details

#error_countObject

Returns the value of attribute error_count.



6
7
8
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 6

def error_count
  @error_count
end

#processedObject

Returns the value of attribute processed.



6
7
8
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 6

def processed
  @processed
end

#rejectedObject

Returns the value of attribute rejected.



6
7
8
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 6

def rejected
  @rejected
end

#sentObject

Returns the value of attribute sent.



6
7
8
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 6

def sent
  @sent
end

Instance Method Details

#prepare_for_health_checkObject



15
16
17
18
19
20
21
22
# File 'lib/newrelic_security/agent/control/event_stats.rb', line 15

def prepare_for_health_check
  hash = {}
  hash[:processed] = @processed.fetch_and_reset_counter
  hash[:sent] = @sent.fetch_and_reset_counter
  hash[:rejected] = @rejected.fetch_and_reset_counter
  hash[:errorCount] = @error_count.fetch_and_reset_counter
  hash
end