mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-11 14:41:16 -07:00
Set default percentile window to 256 samples
This commit is contained in:
@@ -19,9 +19,19 @@ type Percentile struct {
|
||||
value uint64 // These bits are really a float64.
|
||||
}
|
||||
|
||||
// NewPercentile returns a Percentile with a given threshold
|
||||
// NewPercentile returns a Percentile with a given threshold.
|
||||
func NewPercentile(percentile float64) *Percentile {
|
||||
return &Percentile{
|
||||
percentile: percentile,
|
||||
|
||||
// 256 samples is fast, and accurate for most distributions.
|
||||
values: make([]float64, 0, 256),
|
||||
}
|
||||
}
|
||||
|
||||
// NewPercentileWithWindow returns a Percentile with a given threshold
|
||||
// and window size (accuracy).
|
||||
func NewPercentile(percentile float64, sampleWindow int) *Percentile {
|
||||
func NewPercentileWithWindow(percentile float64, sampleWindow int) *Percentile {
|
||||
return &Percentile{
|
||||
percentile: percentile,
|
||||
values: make([]float64, 0, sampleWindow),
|
||||
|
||||
Reference in New Issue
Block a user