Module: Simple::Metrics::Meter
Constant Summary
Constants included from Simple::Metrics
DEFAULT_DURATION_UNIT, DEFAULT_RATE_UNIT, DEFAULT_TIMING_UNIT, VERSION
Instance Method Summary collapse
-
#define_meter(name, options = {}) ⇒ Object
Create a new meter.
Methods included from Simple::Metrics
#metrics_registry, #new_metric_name, #sanitize_classname
Methods included from Timer
Instance Method Details
#define_meter(name, options = {}) ⇒ Object
Create a new meter
‘{}`
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/simple/metrics/meter.rb', line 11 def define_meter(name, ={}) klass_name = [:name] || self.class.name time_unit = [:time_unit] || Simple::Metrics::DEFAULT_RATE_UNIT type = "meter" metric_name = new_metric_name(klass_name, name, type) meter = Java::ComYammerMetrics::Metrics.new_meter(metric_name, name.to_s, time_unit) define_method("#{name}") do meter end end |