feat(metering): add storage size metering and keyspace name caching#9774
feat(metering): add storage size metering and keyspace name caching#9774ti-chi-bot[bot] merged 4 commits intotikv:masterfrom
Conversation
bad0fd4 to
8a87bc4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9774 +/- ##
==========================================
+ Coverage 76.87% 76.89% +0.02%
==========================================
Files 486 488 +2
Lines 77567 77722 +155
==========================================
+ Hits 59628 59768 +140
- Misses 14306 14326 +20
+ Partials 3633 3628 -5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
8a87bc4 to
b501efa
Compare
| regionBoundsMap[keyspaceName] = keyspace.MakeRegionBound(keyspaceID) | ||
| return true | ||
| }) | ||
| log.Info("iterated the region bounds of all keyspaces", |
There was a problem hiding this comment.
It's mainly used to log the duration cost of previous iteration.
| storageSizeInfoList := make([]*storageSizeInfo, 0, len(regionBoundsMap)) | ||
| // Observe the region stats of each keyspace. | ||
| for keyspaceName, regionBounds := range regionBoundsMap { | ||
| regionStats := c.GetRegionStatsByRange(regionBounds.TxnLeftBound, regionBounds.TxnRightBound) |
There was a problem hiding this comment.
Scanning by keyspace is essentially the first level of batching, and then during the internal scan in GetRegionStatsByRange it will further batch in groups of 1000. So my understanding is that as long as the lock on the region meta tree is not held for a long time, the performance impact won’t be significant. Moreover, since this scan runs relatively infrequently, if later testing shows it has a higher impact on performance, we can reduce its frequency, since this metering does not require highly real-time accuracy.
Signed-off-by: JmPotato <github@ipotato.me>
Signed-off-by: JmPotato <github@ipotato.me>
… collector startup Signed-off-by: JmPotato <github@ipotato.me>
…ctor Signed-off-by: JmPotato <github@ipotato.me>
b56e219 to
1e341ae
Compare
|
@JmPotato: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #9707.
What is changed and how does it work?
Check List
Tests
Release note