Class: Gitlab::Usage::ServicePing::InstrumentedPayload
- Inherits:
-
Object
- Object
- Gitlab::Usage::ServicePing::InstrumentedPayload
- Defined in:
- lib/gitlab/usage/service_ping/instrumented_payload.rb
Instance Attribute Summary collapse
-
#metrics_key_paths ⇒ Object
readonly
Returns the value of attribute metrics_key_paths.
-
#output_method ⇒ Object
readonly
Returns the value of attribute output_method.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(metrics_key_paths, output_method) ⇒ InstrumentedPayload
constructor
A new instance of InstrumentedPayload.
Constructor Details
#initialize(metrics_key_paths, output_method) ⇒ InstrumentedPayload
Returns a new instance of InstrumentedPayload.
12 13 14 15 |
# File 'lib/gitlab/usage/service_ping/instrumented_payload.rb', line 12 def initialize(metrics_key_paths, output_method) @metrics_key_paths = metrics_key_paths @output_method = output_method end |
Instance Attribute Details
#metrics_key_paths ⇒ Object (readonly)
Returns the value of attribute metrics_key_paths.
9 10 11 |
# File 'lib/gitlab/usage/service_ping/instrumented_payload.rb', line 9 def metrics_key_paths @metrics_key_paths end |
#output_method ⇒ Object (readonly)
Returns the value of attribute output_method.
10 11 12 |
# File 'lib/gitlab/usage/service_ping/instrumented_payload.rb', line 10 def output_method @output_method end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 |
# File 'lib/gitlab/usage/service_ping/instrumented_payload.rb', line 17 def build metrics_key_paths.map do |key_path| compute_instrumental_value(key_path, output_method) end.reduce({}, :deep_merge) end |