Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: make TSO client request duration include failed requests #8410

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

JmPotato
Copy link
Member

What problem does this PR solve?

Issue Number: ref #8281.

What is changed and how does it work?

Make TSO client request duration include failed requests.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 17, 2024
@HuSharp
Copy link
Member

HuSharp commented Jul 17, 2024

/test build

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.20%. Comparing base (1a20c85) to head (aa9fcb2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8410      +/-   ##
==========================================
- Coverage   77.21%   77.20%   -0.01%     
==========================================
  Files         471      471              
  Lines       61835    61840       +5     
==========================================
- Hits        47747    47745       -2     
- Misses      10499    10501       +2     
- Partials     3589     3594       +5     
Flag Coverage Δ
unittests 77.20% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -141,6 +141,7 @@ func (s *pdTSOStream) processRequests(
}
tsoBatchSendLatency.Observe(time.Since(batchStartTime).Seconds())
resp, err := s.stream.Recv()
requestDurationTSO.Observe(time.Since(start).Seconds())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to distinguish them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to distinguish the duration between success and failure? Currently, I don't think it's necessary because we generally only use this metric to compare TSO Wait Duration to infer the source of the delay, the latter does not distinguish between successful and failed requests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was wondering if we find a latency spike, we might need to know if the request has succeeded or failed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. Addressed. PTAL.

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 17, 2024
@JmPotato JmPotato requested a review from rleungx July 17, 2024 10:17
Copy link
Member

@HuSharp HuSharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please paste a pic to show the metric :)

cmdFailedDurationGet = cmdFailedDuration.WithLabelValues("get")
cmdFailedDurationPut = cmdFailedDuration.WithLabelValues("put")
cmdFailedDurationUpdateGCSafePointV2 = cmdFailedDuration.WithLabelValues("update_gc_safe_point_v2")
cmdFailedDurationUpdateServiceSafePointV2 = cmdFailedDuration.WithLabelValues("update_service_safe_point_v2")

requestDurationTSO = requestDuration.WithLabelValues("tso")
requestFailedDurationTSO = requestDuration.WithLabelValues("tso-failed")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need underline?

Suggested change
requestFailedDurationTSO = requestDuration.WithLabelValues("tso-failed")
requestFailedDurationTSO = requestDuration.WithLabelValues("tso_failed")

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 18, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, rleungx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Jul 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-18 06:29:22.78277505 +0000 UTC m=+508184.773716518: ☑️ agreed by HuSharp.
  • 2024-07-18 06:48:26.702241365 +0000 UTC m=+509328.693182837: ☑️ agreed by rleungx.

@HuSharp
Copy link
Member

HuSharp commented Jul 18, 2024

/hold
avoid automatic merge. please check #8410 (comment) :)
feel free to cancel hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 18, 2024
@HuSharp
Copy link
Member

HuSharp commented Jul 18, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 18, 2024
@ti-chi-bot ti-chi-bot bot merged commit c65577c into tikv:master Jul 18, 2024
21 checks passed
@JmPotato JmPotato deleted the fix_tso_rpc_duration branch July 18, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants