Skip to content

Commit

Permalink
metrics: use second as the unit of latency (#8367)
Browse files Browse the repository at this point in the history
ref #4399

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
rleungx and ti-chi-bot[bot] committed Jul 8, 2024
1 parent 85d650b commit b35f18d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func initMetrics(constLabels prometheus.Labels) {
Subsystem: "request",
Name: "tso_batch_send_latency",
ConstLabels: constLabels,
Buckets: prometheus.ExponentialBuckets(1, 2, 34), // 1ns ~ 8s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 13),
Help: "tso batch send latency",
})

Expand Down
4 changes: 2 additions & 2 deletions client/tso_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (s *pdTSOStream) processRequests(
}
return
}
tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime)))
tsoBatchSendLatency.Observe(time.Since(batchStartTime).Seconds())
resp, err := s.stream.Recv()
if err != nil {
if err == io.EOF {
Expand Down Expand Up @@ -195,7 +195,7 @@ func (s *tsoTSOStream) processRequests(
}
return
}
tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime)))
tsoBatchSendLatency.Observe(time.Since(batchStartTime).Seconds())
resp, err := s.stream.Recv()
if err != nil {
if err == io.EOF {
Expand Down
2 changes: 1 addition & 1 deletion server/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
Subsystem: "scheduler",
Name: "region_heartbeat_latency_seconds",
Help: "Bucketed histogram of latency (s) of receiving heartbeat.",
Buckets: prometheus.ExponentialBuckets(1, 2, 12),
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 13),
}, []string{"address", "store"})

metadataGauge = prometheus.NewGaugeVec(
Expand Down

0 comments on commit b35f18d

Please sign in to comment.