Class: Contrast::Agent::Telemetry::MetricEvent
- Defined in:
- lib/contrast/agent/telemetry/metric_event.rb
Overview
This class will hold the basic information for a Telemetry Event
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Attributes inherited from Event
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize ⇒ MetricEvent
constructor
A new instance of MetricEvent.
- #sys_info ⇒ Object
- #to_controlled_hash(**_args) ⇒ Object
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
Constructor Details
#initialize ⇒ MetricEvent
Returns a new instance of MetricEvent.
19 20 21 22 23 |
# File 'lib/contrast/agent/telemetry/metric_event.rb', line 19 def initialize super @fields = MetricsHash.new(Numeric) @fields['_filler'] = 0 end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
17 18 19 |
# File 'lib/contrast/agent/telemetry/metric_event.rb', line 17 def fields @fields end |
Instance Method Details
#empty? ⇒ Boolean
30 31 32 |
# File 'lib/contrast/agent/telemetry/metric_event.rb', line 30 def empty? Contrast::Utils::DuckUtils.empty_duck?(@fields) end |
#sys_info ⇒ Object
25 26 27 28 |
# File 'lib/contrast/agent/telemetry/metric_event.rb', line 25 def sys_info @sys_info ||= get_system_information if @sys_info.nil? @sys_info end |
#to_controlled_hash(**_args) ⇒ Object
34 35 36 |
# File 'lib/contrast/agent/telemetry/metric_event.rb', line 34 def to_controlled_hash **_args super.merge!({ fields: @fields }) end |