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

changefeedccl: add roachtesting for network metrics #130522

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

asg0451
Copy link
Contributor

@asg0451 asg0451 commented Sep 11, 2024

Add a roachtest helper that checks that the new
cdc network metrics are being emitted. For now it
simply checks that they are > 0.

Part of: #130097

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@asg0451 asg0451 force-pushed the cdc-netmets-roachtests branch 3 times, most recently from b0a756a to 59ac82c Compare September 12, 2024 15:07
@asg0451 asg0451 marked this pull request as ready for review September 12, 2024 15:07
@asg0451 asg0451 requested a review from a team as a code owner September 12, 2024 15:07
@asg0451 asg0451 requested review from DarrylWong, renatolabs, rharding6373 and a team and removed request for a team September 12, 2024 15:07
@asg0451 asg0451 force-pushed the cdc-netmets-roachtests branch 3 times, most recently from 59ac82c to 793e2c7 Compare September 12, 2024 15:13
@asg0451 asg0451 changed the title wip cdc net metrics roachtest changefeedccl: add roachtesting for network metrics Sep 12, 2024
@asg0451 asg0451 force-pushed the cdc-netmets-roachtests branch 2 times, most recently from 2a6c3eb to a88b6e6 Compare September 12, 2024 15:24
Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

Nice verifier! I have only one concern.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @asg0451, @DarrylWong, and @renatolabs)


pkg/cmd/roachtest/tests/cdc.go line 1659 at r1 (raw file):

				steadyLatency:      5 * time.Minute,
			})
			ct.runMetricsVerifier(verifyChangefeedBytesInOutMetricsPresent("changefeed_network_bytes_in", "changefeed_network_bytes_out"))

What do you think about moving this after ct.waitForWorkload(). Although the changefeed has a job id at this point, it's not guaranteed that it has been scheduled, planned, and is processing events even with the 5s grace period as part of runMetricsVerifier. It will likely be less flaky if called at the end of the test, but that depends on if we're reading the metrics live or if we can get historical metrics.

Alternatively, could use testutils.SucceedsSoon to provide a longer grace period to runMetricsVerifier


pkg/cmd/roachtest/tests/cdc.go line 3712 at r1 (raw file):

}

func verifyChangefeedBytesInOutMetricsPresent(

nit: this function that checks metrics seems agnostic to bytes in/out. Might be better named something like verifyMetricNonZero.

@asg0451 asg0451 force-pushed the cdc-netmets-roachtests branch from a88b6e6 to 9187d74 Compare September 12, 2024 16:23
Copy link
Contributor Author

@asg0451 asg0451 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @renatolabs, and @rharding6373)


pkg/cmd/roachtest/tests/cdc.go line 1659 at r1 (raw file):

Previously, rharding6373 (Rachael Harding) wrote…

What do you think about moving this after ct.waitForWorkload(). Although the changefeed has a job id at this point, it's not guaranteed that it has been scheduled, planned, and is processing events even with the 5s grace period as part of runMetricsVerifier. It will likely be less flaky if called at the end of the test, but that depends on if we're reading the metrics live or if we can get historical metrics.

Alternatively, could use testutils.SucceedsSoon to provide a longer grace period to runMetricsVerifier

Fixed. The way i had it before was more convenient for testing it but this should work too and as you say be less flaky.

Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DarrylWong and @renatolabs)

Add a roachtest helper that checks that the new
cdc network metrics are being emitted. For now it
simply checks that they are > 0.

Part of: cockroachdb#130097

Release note: None
@asg0451 asg0451 force-pushed the cdc-netmets-roachtests branch from 9187d74 to 33c96f7 Compare September 12, 2024 17:42
@asg0451
Copy link
Contributor Author

asg0451 commented Sep 12, 2024

bors r=rharding6373

@craig craig bot merged commit a463cb3 into cockroachdb:master Sep 12, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants