Sha256: b322de729bebace4361c5d8b1c78efe80a1628a4fca16bed254b201c882d4a9e

Contents?: true

Size: 496 Bytes

Versions: 9

Compression:

Stored size: 496 Bytes

Contents

require 'json'

module Prometheus
  module Client
    class SimpleValue
      def initialize(_type, _metric_name, _name, _labels, *_args)
        @value = 0.0
      end

      def set(value)
        @value = value
      end

      def increment(by = 1, exemplar_name = '', exemplar_value = '')
        @value += by
      end

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

      def get
        @value
      end

      def self.multiprocess
        false
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vinted-prometheus-client-mmap-1.7.0 lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.7.0-x86_64-linux lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.6.0 lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.6.0-x86_64-linux lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.5.0-x86_64-linux lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.4.0 lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.3.0 lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.2.2 lib/prometheus/client/simple_value.rb
vinted-prometheus-client-mmap-1.2.1 lib/prometheus/client/simple_value.rb