Class: Travis::Metrics::Reporter::Librato
- Inherits:
-
Struct
- Object
- Struct
- Travis::Metrics::Reporter::Librato
- Defined in:
- lib/travis/metrics/reporter/librato.rb
Constant Summary collapse
- MSGS =
{ setup: 'Using Librato metrics reporter (source: %s, account: %s)', error: 'Librato error: %s (%s)' }
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config
6 7 8 |
# File 'lib/travis/metrics/reporter/librato.rb', line 6 def config @config end |
#logger ⇒ Object
Returns the value of attribute logger
6 7 8 |
# File 'lib/travis/metrics/reporter/librato.rb', line 6 def logger @logger end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
12 13 14 |
# File 'lib/travis/metrics/reporter/librato.rb', line 12 def reporter @reporter end |
Instance Method Details
#setup ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/travis/metrics/reporter/librato.rb', line 14 def setup return unless email && token logger.info MSGS[:setup] % [source, email] @reporter = Metriks::LibratoMetricsReporter.new(email, token, source: source, on_error: method(:on_error), percentiles: [0.95, 0.99, 0.999, 1.0], interval: config[:interval], ) reporter.start end |