Skip to content

Commit

Permalink
Let server TSO handle duration including failed requests
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Jun 13, 2024
1 parent c75e98b commit 969adfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metrics/grafana/pd.json
Original file line number Diff line number Diff line change
Expand Up @@ -10679,7 +10679,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "PD server TSO handle time",
"title": "PD server TSO handle duration",
"tooltip": {
"msResolution": false,
"shared": true,
Expand Down Expand Up @@ -10785,7 +10785,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Handle requests duration",
"title": "PD client requests handle duration",
"tooltip": {
"msResolution": false,
"shared": true,
Expand Down
2 changes: 1 addition & 1 deletion server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,10 @@ func (s *GrpcServer) Tso(stream pdpb.PD_TsoServer) error {
ctx, task := trace.NewTask(ctx, "tso")
ts, err := s.tsoAllocatorManager.HandleRequest(ctx, request.GetDcLocation(), count)
task.End()
tsoHandleDuration.Observe(time.Since(start).Seconds())
if err != nil {
return status.Errorf(codes.Unknown, err.Error())
}
tsoHandleDuration.Observe(time.Since(start).Seconds())
response := &pdpb.TsoResponse{
Header: s.header(),
Timestamp: &ts,
Expand Down

0 comments on commit 969adfa

Please sign in to comment.