Class: Couchbase::Metrics::LoggingValueRecorder
- Inherits:
-
ValueRecorder
- Object
- ValueRecorder
- Couchbase::Metrics::LoggingValueRecorder
- Defined in:
- lib/couchbase/metrics/logging_value_recorder.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/lib/couchbase/metrics/logging_value_recorder.rb
Instance Attribute Summary collapse
-
#operation_name ⇒ Object
readonly
Returns the value of attribute operation_name.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(operation_name:, service:) ⇒ LoggingValueRecorder
constructor
A new instance of LoggingValueRecorder.
- #record_value(value) ⇒ Object
- #report_and_reset ⇒ Object
Constructor Details
#initialize(operation_name:, service:) ⇒ LoggingValueRecorder
Returns a new instance of LoggingValueRecorder.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 26 def initialize(operation_name:, service:) super() @operation_name = operation_name @service = service @histogram = Utils::HdrHistogram.new( lowest_discernible_value: 1, # 1 microsecond highest_trackable_value: 30_000_000, # 30 seconds significant_figures: 3, ) end |
Instance Attribute Details
#operation_name ⇒ Object (readonly)
Returns the value of attribute operation_name.
23 24 25 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 23 def operation_name @operation_name end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
24 25 26 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 24 def service @service end |
Instance Method Details
#close ⇒ Object
45 46 47 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 45 def close @histogram.close end |
#record_value(value) ⇒ Object
37 38 39 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 37 def record_value(value) @histogram.record_value(value) end |
#report_and_reset ⇒ Object
41 42 43 |
# File 'lib/couchbase/metrics/logging_value_recorder.rb', line 41 def report_and_reset @histogram.report_and_reset end |