Sha256: 35ec5fc8d0fcb9c30d90543b0dc98c596b2044d9c2a8848c9070e7e22d1bb858

Contents?: true

Size: 411 Bytes

Versions: 6

Compression:

Stored size: 411 Bytes

Contents

require 'json'
require 'mmap'

module Prometheus
  module Client
    class SimpleValue
      def initialize(type, metric_name, name, labels, value = 0)
        @value = value
      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

6 entries across 6 versions & 1 rubygems

Version Path
prometheus-client-mmap-0.7.0.beta14 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta13 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta12 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta11 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta10 lib/prometheus/client/simple_value.rb
prometheus-client-mmap-0.7.0.beta9 lib/prometheus/client/simple_value.rb