Sha256: 414bf5020ac4e70074775ad72cb7d27b26d25274faf80b824f74e6b1857ec5d4

Contents?: true

Size: 469 Bytes

Versions: 10

Compression:

Stored size: 469 Bytes

Contents

# typed: ignore

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.com/terms.html

require 'sqreen/metrics/base'

module Sqreen
  module Metric
    # This perform a sum aggregation
    class Sum < Base
      # from class attr_accessor :aggregate

      def update(key, value)
        super
        s = @sample[OBSERVATION_KEY]
        s[key] ||= 0
        s[key] += value
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sqreen-1.25.1 lib/sqreen/metrics/sum.rb
sqreen-1.25.0 lib/sqreen/metrics/sum.rb
sqreen-1.24.3 lib/sqreen/metrics/sum.rb
sqreen-1.24.2 lib/sqreen/metrics/sum.rb
sqreen-1.24.1 lib/sqreen/metrics/sum.rb
sqreen-1.24.0 lib/sqreen/metrics/sum.rb
sqreen-1.23.2 lib/sqreen/metrics/sum.rb
sqreen-1.23.1 lib/sqreen/metrics/sum.rb
sqreen-1.23.0 lib/sqreen/metrics/sum.rb
sqreen-1.22.1 lib/sqreen/metrics/sum.rb