Browse Source

Add Monitor.SetREMA()

pull/1842/head
Jae Kwon 8 years ago
parent
commit
a20c98e619
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      flowrate/flowrate.go

+ 8
- 0
flowrate/flowrate.go View File

@ -72,6 +72,14 @@ func (m *Monitor) Update(n int) int {
return n
}
// Hack to set the current rEMA.
func (m *Monitor) SetREMA(rEMA float64) {
m.mu.Lock()
m.rEMA = rEMA
m.samples++
m.mu.Unlock()
}
// IO is a convenience method intended to wrap io.Reader and io.Writer method
// execution. It calls m.Update(n) and then returns (n, err) unmodified.
func (m *Monitor) IO(n int, err error) (int, error) {


Loading…
Cancel
Save