@@ -21,25 +21,23 @@ type statistics struct {
21
21
}
22
22
23
23
var (
24
- // 1 microsecond as a fraction of 1 second
25
- us = 1e-6
26
- // buckets starting at 1 microsecond and doubling until reaching a maximum of
27
- // ~8 seconds
28
- durationBuckets = prometheus .ExponentialBuckets (us , 2.0 , 24 )
24
+ // buckets starting at 100 microseconds and doubling until reaching a
25
+ // maximum of ~3.3 seconds
26
+ durationBuckets = prometheus .ExponentialBuckets (1e-4 , 2.0 , 15 )
29
27
)
30
28
31
29
func newStatistics () * statistics {
32
30
return & statistics {
33
31
requestExecDuration : prometheus .NewHistogramVec (prometheus.HistogramOpts {
34
32
Name : "keyless_request_exec_duration_per_opcode" ,
35
- Help : "Time to execute a request not including time in queues, broken down by opcode and error code." ,
33
+ Help : "Time to execute a request not including time in queues, broken down by type and error code." ,
36
34
Buckets : durationBuckets ,
37
- }, []string {"opcode " , "error" }),
35
+ }, []string {"type " , "error" }),
38
36
requestTotalDuration : prometheus .NewHistogramVec (prometheus.HistogramOpts {
39
37
Name : "keyless_request_total_duration_per_opcode" ,
40
- Help : "Total time to satisfy a request including time in queues, broken down by opcode and error code." ,
38
+ Help : "Total time to satisfy a request including time in queues, broken down by type and error code." ,
41
39
Buckets : durationBuckets ,
42
- }, []string {"opcode " , "error" }),
40
+ }, []string {"type " , "error" }),
43
41
requests : prometheus .NewCounterVec (prometheus.CounterOpts {
44
42
Name : "keyless_requests" ,
45
43
Help : "Total number of requests by opcode." ,
@@ -87,11 +85,11 @@ func (stats *statistics) logKeyLoadDuration(loadBegin time.Time) {
87
85
// logRequestExecDuration logs the time taken to execute an operation (not
88
86
// including queueing).
89
87
func (stats * statistics ) logRequestExecDuration (opcode protocol.Op , requestBegin time.Time , err protocol.Error ) {
90
- stats .requestExecDuration .WithLabelValues (opcode .String (), err .String ()).Observe (time .Since (requestBegin ).Seconds ())
88
+ stats .requestExecDuration .WithLabelValues (opcode .Type (), err .String ()).Observe (time .Since (requestBegin ).Seconds ())
91
89
}
92
90
93
91
func (stats * statistics ) logRequestTotalDuration (opcode protocol.Op , requestBegin time.Time , err protocol.Error ) {
94
- stats .requestTotalDuration .WithLabelValues (opcode .String (), err .String ()).Observe (time .Since (requestBegin ).Seconds ())
92
+ stats .requestTotalDuration .WithLabelValues (opcode .Type (), err .String ()).Observe (time .Since (requestBegin ).Seconds ())
95
93
}
96
94
97
95
func (stats * statistics ) logEnqueueECDSARequest () { stats .queuedECDSARequests .Inc () }
0 commit comments