def update(sample)
      now = Time.new
      elapsed = now - @time
      @sum += sample
      if elapsed > 1.0
        @value = newValue elapsed, @sum/elapsed
        @time = now
        @sum = 0.0
      end
    end
def update(sample)
      now = Time.new
      elapsed = now - @time
      @sum += sample
      if elapsed > 1.0
        @value = newValue elapsed, @sum/elapsed
        @time = now
        @sum = 0.0
      end
    end
Update the rate by passing another sample (number) representing units accrued since the last
 call to update.