Sha256: b49277ae85c5de5766c99bc04d82d1a57912659ebc010c166926dc53f46ece3a

Contents?: true

Size: 365 Bytes

Versions: 28

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Metrics
    class DistributionMetric < 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
        value.size
      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/distribution_metric.rb
sentry-ruby-5.17.3 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-5.17.2 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-core-5.17.2 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-core-5.17.1 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-5.17.1 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-5.17.0 lib/sentry/metrics/distribution_metric.rb
sentry-ruby-core-5.17.0 lib/sentry/metrics/distribution_metric.rb