Module: RailsObservatory::TimeSeries::Insertion
- Included in:
- RailsObservatory::TimeSeries
- Defined in:
- lib/rails_observatory/redis/time_series/insertion.rb
Instance Method Summary collapse
-
#distribution(name, value, labels: {}) ⇒ Object
(also: #record_timing)
TODO: These need to take in a timestamp.
- #increment(name, labels: {}) ⇒ Object (also: #record_occurrence)
Instance Method Details
#distribution(name, value, labels: {}) ⇒ Object Also known as: record_timing
TODO: These need to take in a timestamp
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rails_observatory/redis/time_series/insertion.rb', line 47 def distribution(name, value, labels: {}) prefixed_name = begin if defined?(self::PREFIX) [self::PREFIX, name].join('.') else name end end TIMING_SCRIPT.call(prefixed_name, value, labels.to_a.flatten.map(&:to_s)) end |
#increment(name, labels: {}) ⇒ Object Also known as: record_occurrence
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/rails_observatory/redis/time_series/insertion.rb', line 59 def increment(name, labels: {}) prefixed_name = begin if defined?(self::PREFIX) [self::PREFIX, name].join('.') else name end end INCREMENT_CALL.call(prefixed_name, labels.to_a.flatten.map(&:to_s)) end |