Class: GitlabInternalEventsCli::Metric::TimeFrames
- Inherits:
-
Struct
- Object
- Struct
- GitlabInternalEventsCli::Metric::TimeFrames
- 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
- #directory_name ⇒ Object
- #key_path ⇒ Object
-
#single? ⇒ Boolean
TODO: Delete once we are able to deduplicate and merge metric files.
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value
362 363 364 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 362 def value @value end |
Instance Method Details
#description ⇒ Object
363 364 365 366 367 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 363 def description (%w[all 28d 7d] & value).map do |time_trame| TimeFramedKeyPath::METRIC_TIME_FRAME_DESC[time_trame].capitalize end.join('/') end |
#directory_name ⇒ Object
369 370 371 372 373 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 369 def directory_name return 'counts_all' unless single? "counts_#{value.first}" end |
#key_path ⇒ Object
375 376 377 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 375 def key_path description&.downcase if single? && %w[7d 28d].include?(value.first) end |
#single? ⇒ Boolean
TODO: Delete once we are able to deduplicate and merge metric files
380 381 382 |
# File 'lib/gitlab_internal_events_cli/metric.rb', line 380 def single? !value.is_a?(Array) || value.length == 1 end |