Sha256: 54de381bc51dbd6e4011365184c4f953332da4e54d34669dc0b98faaabf90fb7

Contents?: true

Size: 459 Bytes

Versions: 41

Compression:

Stored size: 459 Bytes

Contents

module MCollective
  class Aggregate
    class Sum<Base
      def startup_hook
        @result[:value] = 0
        @result[:type] = :numeric

        # Set default aggregate_function if it is undefined
        @aggregate_format = "Sum of #{@result[:output]}: %f" unless @aggregate_format
      end

      # Determines the average of a set of numerical values
      def process_result(value, reply)
        @result[:value] += value
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
mcollective-client-2.8.0 lib/mcollective/aggregate/sum.rb