class OpenCensus::Stats::AggregationData::Sum
Accumulate measurement values.
Attributes
time[R]
@return [Time] The latest time at new data point was recorded
value[R]
@return [Integer,Float] The current sum value.
Public Class Methods
new()
click to toggle source
@private
# File lib/opencensus/stats/aggregation_data/sum.rb, line 18 def initialize @value = 0 end
Public Instance Methods
add(value, time, attachments: nil)
click to toggle source
Add value @param [Integer,Float] value @param [Time] time Time of data point was recorded @param [Hash<String,String>] attachments Attachments are not in use.
# File lib/opencensus/stats/aggregation_data/sum.rb, line 28 def add value, time, attachments: nil @time = time @value += value end