mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-12 23:08:36 -07:00
Add response time stats
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package stats
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"math"
|
||||
"sort"
|
||||
"sync/atomic"
|
||||
@@ -78,6 +79,10 @@ func (p *Percentile) index() int64 {
|
||||
return idx
|
||||
}
|
||||
|
||||
func (p *Percentile) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(p.Value())
|
||||
}
|
||||
|
||||
func round(value float64) int64 {
|
||||
if value < 0.0 {
|
||||
value -= 0.5
|
||||
|
||||
Reference in New Issue
Block a user