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

resourcemanager: add more test about assign tokens and comments #8399

Merged
merged 7 commits into from
Jul 22, 2024

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Jul 15, 2024

What problem does this PR solve?

Issue Number: Ref #4399

What is changed and how does it work?

resourcemanger: add more test about assign tokens and comments

Check List

Tests

  • Unit 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 15, 2024
@nolouch
Copy link
Contributor Author

nolouch commented Jul 15, 2024

cc @glorv

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.23%. Comparing base (bdbe73e) to head (1596216).
Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8399      +/-   ##
==========================================
- Coverage   77.32%   77.23%   -0.10%     
==========================================
  Files         470      471       +1     
  Lines       61687    61907     +220     
==========================================
+ Hits        47701    47814     +113     
- Misses      10405    10502      +97     
- Partials     3581     3591      +10     
Flag Coverage Δ
unittests 77.23% <ø> (-0.10%) ⬇️

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

Copy link
Contributor

@glorv glorv left a comment

Choose a reason for hiding this comment

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

LGTM

{15000, 12500, -27500, defaultTrickleDuration},
{12500, 11250, -28750, defaultTrickleDuration},
{11250, 10625, -29375, defaultTrickleDuration},
// PR_PER_SEC is close to 2000, RU_PER_SEC = assignedTokens / TrickleTime.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// PR_PER_SEC is close to 2000, RU_PER_SEC = assignedTokens / TrickleTime.
// RU_PER_SEC is close to 2000, RU_PER_SEC = assignedTokens / TrickleTime.

Copy link
Member

Choose a reason for hiding this comment

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

What is the unit for TrickleTime?

const defaultTrickleDuration = int64(time.Second) * 5 / int64(time.Millisecond)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

default ms

Signed-off-by: nolouch <[email protected]>
Signed-off-by: nolouch <[email protected]>
Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

rest lgtm

@@ -144,45 +144,46 @@ func TestGroupTokenBucketRequestLoop(t *testing.T) {
gtb.Tokens = 50000

const timeIncrement = 5 * time.Second
const defaultTrickleDuration = int64(time.Second) * 5 / int64(time.Millisecond)
const targetPeriod = 5 * time.Second
const defaultTrickleMs = int64(targetPeriod) / int64(time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

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

The Millisecond here is meaningless

Suggested change
const defaultTrickleMs = int64(targetPeriod) / int64(time.Millisecond)
const defaultTrickleMs = int64(targetPeriod) / int64(1000)

pkg/mcs/resourcemanager/server/token_buckets_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

ti-chi-bot bot commented Jul 16, 2024

@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

rest lgtm

Instructions 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/test-infra repository.

Signed-off-by: nolouch <[email protected]>
@nolouch nolouch changed the title resourcemanger: add more test about assgn tokens and comments resourcemanger: add more test about assign tokens and comments Jul 17, 2024
@@ -409,6 +409,11 @@ func (ts *TokenSlot) assignSlotTokens(requiredToken float64, targetPeriodMs uint
// |
// grant_rate 0 ------------------------------------------------------------------------------------
// loan *** k*period_token (k+k-1)*period_token *** (k+k+1...+1)*period_token

// loadCoefficient is relative to the capacity of load RUs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// loadCoefficient is relative to the capacity of load RUs.
// loanCoefficient is relative to the capacity of load RUs.

Copy link
Contributor

ti-chi-bot bot commented Jul 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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:20:53.664785951 +0000 UTC m=+507675.655727416: ☑️ agreed by HuSharp.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 18, 2024
Signed-off-by: nolouch <[email protected]>
@nolouch nolouch added require-LGT1 Indicates that the PR requires an LGTM. lgtm labels Jul 22, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 22, 2024

@nolouch: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions 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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 0985e2e into tikv:master Jul 22, 2024
21 checks passed
@nolouch nolouch deleted the add-test branch July 22, 2024 09:54
@nolouch nolouch changed the title resourcemanger: add more test about assign tokens and comments resourcemanager: add more test about assign tokens and comments Jul 22, 2024
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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. require-LGT1 Indicates that the PR requires an LGTM. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants