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, klass_name = self.class.name, time_unit = Simple::Metrics::DEFAULT_RATE_UNIT) ⇒ 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, klass_name = self.class.name, time_unit = Simple::Metrics::DEFAULT_RATE_UNIT) ⇒ Object
Create a new meter
‘self.class.name` TimeUnit::SECONDS
13 14 15 16 17 18 19 20 |
# File 'lib/simple/metrics/meter.rb', line 13 def define_meter(name, klass_name = self.class.name, 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 |