sql: include sampled stats in TestSampledStatsCollection#60424
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Feb 18, 2021
asubiotto:rttm
Merged
sql: include sampled stats in TestSampledStatsCollection#60424craig[bot] merged 1 commit intocockroachdb:masterfrom asubiotto:rttm
craig[bot] merged 1 commit intocockroachdb:masterfrom
asubiotto:rttm
Conversation
Member
yuzefovich
approved these changes
Feb 10, 2021
Member
yuzefovich
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r5.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @asubiotto)
pkg/sql/instrumentation_test.go, line 83 at r5 (raw file):
require.Equal(t, int64(1), stats.mu.data.ExecStatCollectionCount, "expected to have collected exactly one set of execution stats") require.Greater(t, stats.mu.data.RowsRead.Mean, float64(0), "expected statement to have read at least one row") require.Greater(t, stats.mu.data.MaxMemUsage.Mean, float64(0), "expected statement to have requested bytes")
nit: to me "to have requested bytes" reads like it is more about BytesRead and not MaxMemUsage, maybe expected statement to request some RAM or something like that?
TestSampledStatsCollection would previously only check that stats that are collected regardless of the sample rate are returned. These types of stats (rows/bytes read) are propagated using metadata, rather than the trace. This resulted in us silently failing to collect any stats when sampling was enabled once the tracing mode was reverted back to legacy. To avoid this kind of thing happening again, this commit adds a check that max memory usage is reported to be non-zero. Release note: None (this is a new feature that has no user impact yet)
asubiotto
commented
Feb 18, 2021
Contributor
Author
asubiotto
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained
pkg/sql/instrumentation_test.go, line 83 at r5 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: to me "to have requested bytes" reads like it is more about BytesRead and not MaxMemUsage, maybe
expected statement to request some RAMor something like that?
Done.
Contributor
Author
|
TFTR bors r=yuzefovich |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #59992, which is required for this new regression test to pass.
TestSampledStatsCollection would previously only check that stats that are
collected regardless of the sample rate are returned. These types of stats
(rows/bytes read) are propagated using metadata, rather than the trace.
This resulted in us silently failing to collect any stats when sampling was
enabled once the tracing mode was reverted back to legacy. To avoid this kind
of thing happening again, this commit adds a check that max memory usage is
reported to be non-zero.
Release note: None (this is a new feature that has no user impact yet)