Skip to content

Add metric for table size relative to storage load #616

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

Open
wants to merge 4 commits into
base: palantir-cassandra-2.2.18
Choose a base branch
from

Conversation

DaaanJan
Copy link

@DaaanJan DaaanJan commented Feb 17, 2025

This PR adds a metric for a columnfamily's storage load relative to global storage load. This will help establish tables that are so large that we might no longer be able to compact them if we are also running short on disk space.

@DaaanJan DaaanJan marked this pull request as ready for review February 18, 2025 08:41
@@ -453,6 +455,9 @@ public Long getValue()
}
});
liveDiskSpaceUsed = createColumnFamilyCounter("LiveDiskSpaceUsed");
liveDiskSpaceUsedRatio = Metrics.register(
factory.createMetricName("LiveDiskSpaceUsedRatio"),
() -> (double) liveDiskSpaceUsed.getCount() / StorageMetrics.load.getCount());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be the supported way of doing this:

hitRate = Metrics.register(factory.createMetricName("HitRate"), new RatioGauge()
{
@Override
public Ratio getRatio()
{
return Ratio.of(hits.getCount(), requests.getCount());
}
});

Copy link
Author

Choose a reason for hiding this comment

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

Nice find, I've implemented that same pattern!

@DaaanJan DaaanJan requested a review from inespot April 9, 2025 08:45
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