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

AvgOverTime can not work well #6301

Closed
bufferflies opened this issue Apr 11, 2023 · 0 comments · Fixed by #6302
Closed

AvgOverTime can not work well #6301

bufferflies opened this issue Apr 11, 2023 · 0 comments · Fixed by #6302
Assignees
Labels
severity/moderate type/bug The issue is confirmed as a bug.

Comments

@bufferflies
Copy link
Contributor

bufferflies commented Apr 11, 2023

Bug Report

What did you do?

func TestPulse2(t *testing.T) {
	t.Parallel()
	re := require.New(t)
	dur := 5 * time.Second
	aot := NewAvgOverTime(dur)
	aot.Add(1000, dur)
	re.Equal(float64(1000), aot.GetInstantaneous())
	aot.Clear()
	aot.Add(1000, dur)
	re.Equal(float64(1000), aot.GetInstantaneous())
}

What did you expect to see?

GetInstantaneous is lastest value

What did you see instead?

GetInstantaneous is zero

What version of PD are you using (pd-server -V)?

master

@bufferflies bufferflies added the type/bug The issue is confirmed as a bug. label Apr 11, 2023
@bufferflies bufferflies self-assigned this Apr 11, 2023
ti-chi-bot added a commit that referenced this issue Apr 12, 2023
close #6301

Signed-off-by: bufferflies <1045931706@qq.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant