Class: HttpStatsd::Client::BatchOperation
- Inherits:
-
Object
- Object
- HttpStatsd::Client::BatchOperation
- Defined in:
- lib/http_statsd/client.rb
Instance Attribute Summary collapse
-
#metrics ⇒ Object
Returns the value of attribute metrics.
Instance Method Summary collapse
- #count(name, value, sample_rate = nil) ⇒ Object
- #decrement(name, sample_rate = nil) ⇒ Object
- #gauge(name, value) ⇒ Object
- #increment(name, sample_rate = nil) ⇒ Object
-
#initialize ⇒ BatchOperation
constructor
A new instance of BatchOperation.
- #timing(name, value, sample_rate = nil) ⇒ Object
Constructor Details
#initialize ⇒ BatchOperation
Returns a new instance of BatchOperation.
61 62 63 |
# File 'lib/http_statsd/client.rb', line 61 def initialize @metrics = [] end |
Instance Attribute Details
#metrics ⇒ Object
Returns the value of attribute metrics.
59 60 61 |
# File 'lib/http_statsd/client.rb', line 59 def metrics @metrics end |
Instance Method Details
#count(name, value, sample_rate = nil) ⇒ Object
73 74 75 |
# File 'lib/http_statsd/client.rb', line 73 def count(name, value, sample_rate = nil) @metrics << "count #{name} #{value} #{sample_rate}".strip end |
#decrement(name, sample_rate = nil) ⇒ Object
69 70 71 |
# File 'lib/http_statsd/client.rb', line 69 def decrement(name, sample_rate = nil) @metrics << "count #{name} -1 #{sample_rate}".strip end |
#gauge(name, value) ⇒ Object
77 78 79 |
# File 'lib/http_statsd/client.rb', line 77 def gauge(name, value) @metrics << "gauge #{name} #{value}".strip end |
#increment(name, sample_rate = nil) ⇒ Object
65 66 67 |
# File 'lib/http_statsd/client.rb', line 65 def increment(name, sample_rate = nil) @metrics << "count #{name} 1 #{sample_rate}".strip end |
#timing(name, value, sample_rate = nil) ⇒ Object
81 82 83 |
# File 'lib/http_statsd/client.rb', line 81 def timing(name, value, sample_rate = nil) @metrics << "timing #{name} #{value} #{sample_rate}".strip end |