Class: DDMetrics::Summary

Inherits:
Metric
  • Object
show all
Defined in:
lib/ddmetrics/summary.rb

Instance Method Summary collapse

Methods inherited from Metric

#basic_metric_for, #each, #initialize, #labels, #validate_label

Constructor Details

This class inherits a constructor from DDMetrics::Metric

Instance Method Details

#get(label) ⇒ Object



10
11
12
13
14
# File 'lib/ddmetrics/summary.rb', line 10

def get(label)
  validate_label(label)
  values = basic_metric_for(label, BasicSummary).values
  DDMetrics::Stats.new(values)
end

#observe(value, label) ⇒ Object



5
6
7
8
# File 'lib/ddmetrics/summary.rb', line 5

def observe(value, label)
  validate_label(label)
  basic_metric_for(label, BasicSummary).observe(value)
end

#to_sObject



16
17
18
# File 'lib/ddmetrics/summary.rb', line 16

def to_s
  DDMetrics::Printer.new.summary_to_s(self)
end