Class: Prometheus::Client::SimpleValue

Inherits:
Object
  • Object
show all
Defined in:
lib/prometheus/client/simple_value.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_type, _metric_name, _name, _labels, *_args) ⇒ SimpleValue

Returns a new instance of SimpleValue.



6
7
8
# File 'lib/prometheus/client/simple_value.rb', line 6

def initialize(_type, _metric_name, _name, _labels, *_args)
  @value = 0.0
end

Class Method Details

.multiprocessObject



26
27
28
# File 'lib/prometheus/client/simple_value.rb', line 26

def self.multiprocess
  false
end

Instance Method Details

#decrement(by = 1) ⇒ Object



18
19
20
# File 'lib/prometheus/client/simple_value.rb', line 18

def decrement(by = 1)
  @value -= by
end

#getObject



22
23
24
# File 'lib/prometheus/client/simple_value.rb', line 22

def get
  @value
end

#increment(by = 1) ⇒ Object



14
15
16
# File 'lib/prometheus/client/simple_value.rb', line 14

def increment(by = 1)
  @value += by
end

#set(value) ⇒ Object



10
11
12
# File 'lib/prometheus/client/simple_value.rb', line 10

def set(value)
  @value = value
end