Преглед на файлове

correct *StandardEWMA.Rate() sync event

Jeff Hodges преди 14 години
родител
ревизия
bd338be35d
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      ewma.go

+ 1 - 1
ewma.go

@@ -53,7 +53,7 @@ func NewEWMA15() *StandardEWMA {
 
 // Return the moving average rate of events per second.
 func (a *StandardEWMA) Rate() float64 {
-	return a.rate * float64(1e9)
+	return <-a.out * float64(1e9)
 }
 
 // Tick the clock to update the moving average.