Class: GitlabInternalEventsCli::Metric::Operator
- Inherits:
-
Struct
- Object
- Struct
- GitlabInternalEventsCli::Metric::Operator
- Defined in:
- lib/gitlab_internal_events_cli/metric.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #description ⇒ Object
- #key_path ⇒ Object
- #qualifier ⇒ Object
- #reference(identifier) ⇒ Object
- #verb ⇒ Object
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value
481 482 483 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 481 def value @value end |
Instance Method Details
#description ⇒ Object
482 483 484 485 486 487 488 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 482 def description if qualifier "#{verb} of #{qualifier}" else "#{verb} of" end end |
#key_path ⇒ Object
498 499 500 501 502 503 504 505 506 507 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 498 def key_path case value when 'unique_count' 'redis_hll_counters' when 'count' 'counts' when 'sum' 'sums' end end |
#qualifier ⇒ Object
509 510 511 512 513 514 515 516 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 509 def qualifier case value when 'unique_count' 'unique' when 'sum' 'all' end end |
#reference(identifier) ⇒ Object
494 495 496 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 494 def reference(identifier) "#{verb}(#{identifier.value})" end |
#verb ⇒ Object
490 491 492 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 490 def verb value == 'unique_count' ? 'count' : value end |