Class: PrometheusExporter::Ext::Instrumentation::BaseStats

Inherits:
Object
  • Object
show all
Defined in:
lib/prometheus_exporter/ext/instrumentation/base_stats.rb

Direct Known Subclasses

PeriodicStats

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: PrometheusExporter::Client.default, labels: {}) ⇒ BaseStats

Returns a new instance of BaseStats.



12
13
14
15
# File 'lib/prometheus_exporter/ext/instrumentation/base_stats.rb', line 12

def initialize(client: PrometheusExporter::Client.default, labels: {})
  @labels = labels.transform_keys(&:to_sym)
  @client = client
end

Class Attribute Details

.typeObject

Returns the value of attribute type.



9
10
11
# File 'lib/prometheus_exporter/ext/instrumentation/base_stats.rb', line 9

def type
  @type
end

Instance Method Details

#collectObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/prometheus_exporter/ext/instrumentation/base_stats.rb', line 21

def collect
  raise NotImplementedError
end

#typeObject



17
18
19
# File 'lib/prometheus_exporter/ext/instrumentation/base_stats.rb', line 17

def type
  self.class.type
end