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

top metrics #79

Merged
merged 5 commits into from
Sep 16, 2024
Merged

top metrics #79

merged 5 commits into from
Sep 16, 2024

Conversation

yuchen-db
Copy link

@yuchen-db yuchen-db commented Sep 16, 2024

@yuchen-db yuchen-db requested review from a team, christopherzli, jnyi, hczhu-db and yulong-db and removed request for a team September 16, 2024 22:05
return runutil.Repeat(conf.topMetricsUpdateInterval, ctx.Done(), func() error {
level.Error(logger).Log("msg", "getting top metrics")
for _, ts := range dbs.TenantStats(conf.numTopMetricsPerTenant, labels.MetricName) {
for _, ms := range ts.Stats.IndexPostingStats.CardinalityMetricsStats {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the return value not a reference so no read lock are needed? maybe use go -race to check

level.Error(logger).Log("msg", "getting top metrics")
for _, ts := range dbs.TenantStats(conf.numTopMetricsPerTenant, labels.MetricName) {
for _, ms := range ts.Stats.IndexPostingStats.CardinalityMetricsStats {
if ms.Count >= conf.topMetricsMinimumCardinality {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 we can avoid emitting small metrics

@yuchen-db yuchen-db merged commit 00fc9e6 into db_main Sep 16, 2024
12 checks passed
@jnyi jnyi deleted the yuchen-db/top-metrics branch November 1, 2024 23:12
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.

2 participants