Class: Librato::Collector
- Inherits:
-
Object
- Object
- Librato::Collector
- Extended by:
- Forwardable
- Defined in:
- lib/librato/collector.rb,
lib/librato/collector/group.rb,
lib/librato/collector/aggregator.rb,
lib/librato/collector/exceptions.rb,
lib/librato/collector/counter_cache.rb
Overview
collects and stores measurement values over time so they can be reported periodically to the Metrics service
Defined Under Namespace
Classes: Aggregator, CounterCache, Group, InvalidPercentile
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#aggregate ⇒ Object
access to internal aggregator object.
-
#counters ⇒ Object
access to internal counters object.
-
#delete_all ⇒ Object
(also: #clear)
remove any accumulated but unsent metrics.
- #group(prefix) {|group| ... } ⇒ Object
-
#initialize(options = {}) ⇒ Collector
constructor
A new instance of Collector.
- #prefix ⇒ Object
-
#prefix=(new_prefix) ⇒ Object
update prefix.
Constructor Details
#initialize(options = {}) ⇒ Collector
Returns a new instance of Collector.
15 16 17 |
# File 'lib/librato/collector.rb', line 15 def initialize(={}) = [:tags] end |
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
13 14 15 |
# File 'lib/librato/collector.rb', line 13 def end |
Instance Method Details
#aggregate ⇒ Object
access to internal aggregator object
20 21 22 |
# File 'lib/librato/collector.rb', line 20 def aggregate @aggregator_cache ||= Aggregator.new(prefix: @prefix, default_tags: ) end |
#counters ⇒ Object
access to internal counters object
25 26 27 |
# File 'lib/librato/collector.rb', line 25 def counters @counter_cache ||= CounterCache.new(default_tags: ) end |
#delete_all ⇒ Object Also known as: clear
remove any accumulated but unsent metrics
30 31 32 33 |
# File 'lib/librato/collector.rb', line 30 def delete_all aggregate.delete_all counters.delete_all end |
#group(prefix) {|group| ... } ⇒ Object
36 37 38 39 |
# File 'lib/librato/collector.rb', line 36 def group(prefix) group = Group.new(self, prefix) yield group end |
#prefix ⇒ Object
47 48 49 |
# File 'lib/librato/collector.rb', line 47 def prefix @prefix end |
#prefix=(new_prefix) ⇒ Object
update prefix
42 43 44 45 |
# File 'lib/librato/collector.rb', line 42 def prefix=(new_prefix) @prefix = new_prefix aggregate.prefix = @prefix end |