Sha256: 04d4c10544f140cf0ab44574738f0bf748500ce04386e4c5af429f18cfb7e91c

Contents?: true

Size: 410 Bytes

Versions: 7

Compression:

Stored size: 410 Bytes

Contents

require 'json'
require 'mmap'

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)
        @value += by
      end

      def get
        @value
      end

      def self.multiprocess
        false
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prometheus-client-mmap-0.7.0.beta41 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta40 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta39 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta38 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta37 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta36 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta35 lib/prometheus/client/simple_value.rb