Skip to content

Commit

Permalink
server: make the region heartbeat metric units correct (tikv#1128)
Browse files Browse the repository at this point in the history
* server: make the region heartbeat metric units correct

* address comment
  • Loading branch information
nolouch committed Aug 15, 2018
1 parent e55a352 commit 07819e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (s *Server) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error {
storeLabel := strconv.FormatUint(storeID, 10)

regionHeartbeatCounter.WithLabelValues(storeLabel, "report", "recv").Inc()
regionHeartbeatLatency.WithLabelValues(storeLabel).Observe(float64(time.Now().UnixNano()/int64(time.Millisecond)) - float64(request.GetInterval().GetEndTimestamp()))
regionHeartbeatLatency.WithLabelValues(storeLabel).Observe(float64(time.Now().Unix()) - float64(request.GetInterval().GetEndTimestamp()))

hbStreams := cluster.coordinator.hbStreams

Expand Down
2 changes: 1 addition & 1 deletion server/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var (
Subsystem: "scheduler",
Name: "region_heartbeat_latency_seconds",
Help: "Bucketed histogram of latency (s) of receiving heartbeat.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15),
Buckets: prometheus.ExponentialBuckets(1, 2, 12),
}, []string{"store"})

storeStatusGauge = prometheus.NewGaugeVec(
Expand Down

0 comments on commit 07819e7

Please sign in to comment.