mirror of
https://github.com/aykhans/sarin.git
synced 2026-10-16 14:43:53 +00:00
✨ Add latency percentiles to the results table
This commit is contained in:
1 parent
3068e0acae
commit
bd33b2c6a2
2 files changed
+57
-58
No files matched your search
@@ -1,31 +0,0 @@
|
||||
package utils
|
||||
|
||||
import "time"
|
||||
|
||||
func MinDuration(durations ...time.Duration) time.Duration {
|
||||
min := durations[0]
|
||||
for _, d := range durations {
|
||||
if d < min {
|
||||
min = d
|
||||
}
|
||||
}
|
||||
return min
|
||||
}
|
||||
|
||||
func MaxDuration(durations ...time.Duration) time.Duration {
|
||||
max := durations[0]
|
||||
for _, d := range durations {
|
||||
if d > max {
|
||||
max = d
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
|
||||
func AvgDuration(durations ...time.Duration) time.Duration {
|
||||
total := time.Duration(0)
|
||||
for _, d := range durations {
|
||||
total += d
|
||||
}
|
||||
return total / time.Duration(len(durations))
|
||||
}
|
||||
Reference in new issue
Block a user