Class: SidekiqQueueStatus::Metric
- Inherits:
-
Object
- Object
- SidekiqQueueStatus::Metric
- Defined in:
- lib/sidekiq_queue_status/metric.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Result
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
- #error(message) ⇒ Object
-
#initialize ⇒ Metric
constructor
A new instance of Metric.
Constructor Details
#initialize ⇒ Metric
Returns a new instance of Metric.
15 16 17 18 |
# File 'lib/sidekiq_queue_status/metric.rb', line 15 def initialize @errors = [] @result = monitor end |
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/sidekiq_queue_status/metric.rb', line 6 def config @config end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
14 15 16 |
# File 'lib/sidekiq_queue_status/metric.rb', line 14 def errors @errors end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
14 15 16 |
# File 'lib/sidekiq_queue_status/metric.rb', line 14 def result @result end |
Class Method Details
.all ⇒ Object
7 8 9 10 11 |
# File 'lib/sidekiq_queue_status/metric.rb', line 7 def all metrics = QueueLatency.new, FailureRate.new errors = metrics.map(&:errors).flatten Result.new(*metrics.map(&:result), errors) end |
Instance Method Details
#error(message) ⇒ Object
20 21 22 |
# File 'lib/sidekiq_queue_status/metric.rb', line 20 def error() @errors << end |