Class: ModularizationStatistics::GaugeMetric
- Inherits:
-
T::Struct
- Object
- T::Struct
- ModularizationStatistics::GaugeMetric
- Extended by:
- T::Sig
- Defined in:
- lib/modularization_statistics/gauge_metric.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.for(metric_name, count, tags) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/modularization_statistics/gauge_metric.rb', line 12 def self.for(metric_name, count, ) name = "modularization.#{metric_name}" # https://docs.datadoghq.com/metrics/custom_metrics/#naming-custom-metrics # Metric names must not exceed 200 characters. Fewer than 100 is preferred from a UI perspective if name.length > 200 raise StandardError.new("Metrics names must not exceed 200 characters: #{name}") # rubocop:disable Style/RaiseArgs end new( name: name, count: count, tags: ) end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 36 37 |
# File 'lib/modularization_statistics/gauge_metric.rb', line 33 def ==(other) other.name == self.name && other.count == self.count && other. == self. end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/modularization_statistics/gauge_metric.rb', line 28 def to_s "#{name} with count #{count}, with tags #{.map(&:to_s).join(', ')}" end |