Module: LogStash::Instrument::MetricType

Defined in:
lib/logstash/instrument/metric_type.rb,
lib/logstash/instrument/metric_type/gauge.rb,
lib/logstash/instrument/metric_type/counter.rb

Defined Under Namespace

Classes: Counter, Gauge

Constant Summary collapse

METRIC_TYPE_LIST =
{
  :counter => LogStash::Instrument::MetricType::Counter,
  :gauge => LogStash::Instrument::MetricType::Gauge
}.freeze

Class Method Summary collapse

Class Method Details

.create(type, namespaces, key) ⇒ Object

Use the string to generate a concrete class for this metrics

Parameters:

  • The (String)

    name of the class

  • Namespaces (Array)

    list

  • The (String)

    metric key

Raises:

  • (NameError)

    If the class is not found



18
19
20
# File 'lib/logstash/instrument/metric_type.rb', line 18

def self.create(type, namespaces, key)
  METRIC_TYPE_LIST[type].new(namespaces, key)
end