Sha256: 1fccafb62b6a0316b9019839c29c7f3a0fdc41b54d62002a30808b145946243f

Contents?: true

Size: 351 Bytes

Versions: 28

Compression:

Stored size: 351 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Metrics
    class CounterMetric < Metric
      attr_reader :value

      def initialize(value)
        @value = value.to_f
      end

      def add(value)
        @value += value.to_f
      end

      def serialize
        [value]
      end

      def weight
        1
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
sentry-ruby-core-5.17.3 lib/sentry/metrics/counter_metric.rb
sentry-ruby-5.17.3 lib/sentry/metrics/counter_metric.rb
sentry-ruby-5.17.2 lib/sentry/metrics/counter_metric.rb
sentry-ruby-core-5.17.2 lib/sentry/metrics/counter_metric.rb
sentry-ruby-core-5.17.1 lib/sentry/metrics/counter_metric.rb
sentry-ruby-5.17.1 lib/sentry/metrics/counter_metric.rb
sentry-ruby-5.17.0 lib/sentry/metrics/counter_metric.rb
sentry-ruby-core-5.17.0 lib/sentry/metrics/counter_metric.rb