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

tools/heartbeat: support to collect metrics #8235

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented May 31, 2024

What problem does this PR solve?

Issue Number: Ref #8135

What is changed and how does it work?

tools/heartbeat: support to collect metrics
[2024/06/03 17:43:42.829 +08:00] [INFO] [util.go:162] ["metrics collected"] [round=4] [metrics="[max cpu usage(%)] 423.3333333333 [max memory usage(G)] 5.0294342041 [max go routines] 672.0000000000 [99% Heartbeat Latency(ms)] 0.0027463236 [Avg Heartbeat Latency(ms)] 0.0001914771 [AsyncHotStatsDuration] 0.1390788685 [CollectRegionStats] 0.0004269015 [Other] 0.3516389173 [PreCheck] 0.1390788685 [RegionGuide] 0.0041669604 [SaveCache_CheckOverlaps] 0.2434654559 [SaveCache_InvalidRegion] 0.0001080596 [SaveCache_SetRegion] 0.0080712888 [SaveCache_UpdateSubTree] 0.0027561614 "]
[2024/06/03 17:43:42.835 +08:00] [INFO] [main.go:648] ["update speed of each category"] [rps=193556.5518] [save-tree=11613.3931] [save-kv=0.0000] [save-space=0.0000] [save-flow=0.0000] [skip=181943.1587]
[2024/06/03 17:43:42.981 +08:00] [INFO] [main.go:560] ["region heartbeat stats"] [total=5.1663s] [slowest=2.9141s] [fastest=0.0000s] [average=1.3855s] [stddev=0.8114s] [rps=193561.3225] [max-epoch-version=1]
[2024/06/03 17:43:42.981 +08:00] [INFO] [main.go:562] ["store heartbeat stats"] [max=5.1664s]
[2024/06/03 17:44:37.663 +08:00] [INFO] [util.go:218] ["final metrics collected"] [total=9.7689s] [slowest=9.2799s] [fastest=0.0000s] [average=4.3321s] [stddev=2.7548s] [rps=117480.8411] ["avg store time"=9.7688943294] [metrics="[max cpu usage(%)] 423.3333333333 [max memory usage(G)] 5.0294342041 [max go routines] 672.0000000000 [99% Heartbeat Latency(ms)] 0.0027463236 [Avg Heartbeat Latency(ms)] 0.0001914771 [AsyncHotStatsDuration] 0.1390788685 [CollectRegionStats] 0.0004269015 [Other] 0.3516389173 [PreCheck] 0.1390788685 [RegionGuide] 0.0041669604 [SaveCache_CheckOverlaps] 0.2434654559 [SaveCache_InvalidRegion] 0.0001080596 [SaveCache_SetRegion] 0.0080712888 [SaveCache_UpdateSubTree] 0.0027561614 "]

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release note

None.

Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp requested review from nolouch and rleungx May 31, 2024 10:05
Copy link
Contributor

ti-chi-bot bot commented May 31, 2024

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 31, 2024
Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.36%. Comparing base (199b017) to head (37d30f6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8235      +/-   ##
==========================================
+ Coverage   77.26%   77.36%   +0.10%     
==========================================
  Files         471      471              
  Lines       61346    61369      +23     
==========================================
+ Hits        47401    47481      +80     
+ Misses      10383    10324      -59     
- Partials     3562     3564       +2     
Flag Coverage Δ
unittests 77.36% <ø> (+0.10%) ⬆️

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

Signed-off-by: husharp <jinhao.hu@pingcap.com>
c.String(http.StatusBadRequest, "invalid second")
return
}
metrics.InitMetric2Collect(cfg.MetricsAddr)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe there is no monitor if it only runs binaries.

Signed-off-by: husharp <jinhao.hu@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants