From 775153080250e94bbd41a290ab08101841ecb50e Mon Sep 17 00:00:00 2001 From: ShuNing Date: Thu, 25 Mar 2021 14:47:24 +0800 Subject: [PATCH] cherry pick #3523 to release-5.0 Signed-off-by: ti-srebot --- server/grpc_service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/grpc_service.go b/server/grpc_service.go index ccef80026f1..1b1ca9cbee9 100644 --- a/server/grpc_service.go +++ b/server/grpc_service.go @@ -169,6 +169,7 @@ func (s *Server) Tso(stream pdpb.PD_TsoServer) error { if elapsed > slowThreshold { log.Warn("get timestamp too slow", zap.Duration("cost", elapsed)) } + tsoHandleDuration.Observe(time.Since(start).Seconds()) response := &pdpb.TsoResponse{ Header: s.header(), Timestamp: &ts, @@ -177,7 +178,6 @@ func (s *Server) Tso(stream pdpb.PD_TsoServer) error { if err := stream.Send(response); err != nil { return errors.WithStack(err) } - tsoHandleDuration.Observe(time.Since(start).Seconds()) } }