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

Introduce Stats API to expose valustore statistics #115

Merged
merged 1 commit into from
Nov 24, 2022
Merged

Conversation

masih
Copy link
Member

@masih masih commented Nov 24, 2022

Expose an API that, when supported by the backing store, it returns the number of unique multihashes stored.

Implement stats calculation for pebble as an estimate of the number of entries in SST files when the key range falls with the multihash key start/end.

Relates to: ipni/storetheindex#982

Expose an API that, when supported by the backing store, it returns the
number of unique multihashes stored.

Implement stats calculation for pebble as an estimate of the number of
entries in SST files when the key range falls with the multihash key
start/end.

Relates to: ipni/storetheindex#982
// overwhelmingly larger than provider records.
if s.comparer.Compare(start.buf, info.Smallest.UserKey) <= 0 ||
s.comparer.Compare(end.buf, info.Largest.UserKey) <= 0 {
stats.MultihashCount += info.Properties.NumEntries
Copy link
Member

Choose a reason for hiding this comment

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

do we have a sense of how expensive this is?

Copy link
Member Author

Choose a reason for hiding this comment

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

It took 13 seconds to return on dido's snapshot from 2nd of Nov.

Expense here just means it might take time. It scans each of the SST files.

@masih masih merged commit aaa74eb into main Nov 24, 2022
@masih masih deleted the masih/record_count branch November 24, 2022 17:14
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