Class: Contrast::Agent::Telemetry::InputAnalysisEvent

Inherits:
MetricEvent show all
Includes:
Components::Logger::InstanceMethods
Defined in:
lib/contrast/agent/telemetry/input_analysis_event.rb

Overview

Event to report all gather information from the Input Analysis metrics.

Constant Summary collapse

NOT_APPLICABLE =
'n/a'
NAME =

Override the name for any derived classes

'InputAnalysis event'
PATH =

Override the path for any derived classes

'/protect_input_analysis'

Instance Attribute Summary collapse

Attributes inherited from Event

#tags

Instance Method Summary collapse

Methods included from Components::Logger::InstanceMethods

#cef_logger, #logger

Methods inherited from MetricEvent

#sys_info, #to_controlled_hash

Methods included from Utils::OS

get_system_information, mac?, windows?

Methods included from Components::Scope::InstanceMethods

#contrast_enter_method_scopes!, #contrast_exit_method_scopes!, #with_app_scope, #with_contrast_scope, #with_deserialization_scope, #with_split_scope

Methods inherited from Event

#to_controlled_hash

Constructor Details

#initialize(rule_id, rates) ⇒ InputAnalysisEvent

Returns a new instance of InputAnalysisEvent.

Parameters:



26
27
28
29
30
31
# File 'lib/contrast/agent/telemetry/input_analysis_event.rb', line 26

def initialize rule_id, rates
  super()
  @fields = MetricsHash.new(Integer)
  add_tags(rule_id, rates)
  generate_fields(rates)
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



17
18
19
# File 'lib/contrast/agent/telemetry/input_analysis_event.rb', line 17

def fields
  @fields
end

Instance Method Details

#empty?Boolean

Override the empty check for any derived classes if needed.

Returns:

  • (Boolean)


48
49
50
# File 'lib/contrast/agent/telemetry/input_analysis_event.rb', line 48

def empty?
  super && Contrast::Utils::DuckUtils.empty_duck?(@tags)
end

#nameString

Returns the name of the event.

Returns:



36
37
38
# File 'lib/contrast/agent/telemetry/input_analysis_event.rb', line 36

def name
  cs__class::NAME
end

#pathString

Returns the path to report the event.

Returns:



43
44
45
# File 'lib/contrast/agent/telemetry/input_analysis_event.rb', line 43

def path
  cs__class::PATH
end