-
Notifications
You must be signed in to change notification settings - Fork 660
/
metrics.go
59 lines (55 loc) · 1.28 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// (c) 2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package utils
import (
"time"
)
// Useful latency buckets
var (
MillisecondsBuckets = []float64{
10, // 10 ms is ~ instant
100, // 100 ms
250, // 250 ms
500, // 500 ms
1000, // 1 second
1500, // 1.5 seconds
2000, // 2 seconds
3000, // 3 seconds
5000, // 5 seconds
10000, // 10 seconds
// anything larger than 10 seconds will be bucketed together
}
NanosecondsBuckets = []float64{
float64(100 * time.Nanosecond),
float64(time.Microsecond),
float64(10 * time.Microsecond),
float64(100 * time.Microsecond),
float64(time.Millisecond),
float64(10 * time.Millisecond),
float64(100 * time.Millisecond),
float64(time.Second),
// anything larger than a second will be bucketed together
}
MillisecondsHTTPBuckets = []float64{
100, // 100 ms - instant
250, // 250 ms - good
500, // 500 ms - not great
1000, // 1 second - worrisome
5000, // 5 seconds - bad
// anything larger than 5 seconds will be bucketed together
}
)
// Useful bytes buckets
var (
BytesBuckets = []float64{
1 << 8,
1 << 10, // 1 KiB
1 << 12,
1 << 14,
1 << 16,
1 << 18,
1 << 20, // 1 MiB
1 << 22,
// anything larger than 4 MiB will be bucketed together
}
)