Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Feb 3, 2025

Why this should be merged

Allows for ava-labs/coreth equivalent modifications of rawdb.InspectDatabase() through external logic injection.

How this works

Variadic options to:

  1. Record a database statistic;
  2. Mark a database statistic as metadata;
  3. Filter statistics for printing.

How this was tested

Testable example acting as a unit test.

@ARR4N ARR4N marked this pull request as ready for review February 3, 2025 11:54
@ARR4N ARR4N requested review from a team, ceyonur, darioush and qdm12 and removed request for a team February 3, 2025 11:55
@qdm12
Copy link

qdm12 commented Feb 3, 2025

Do we need tests of this?

I'm happy to write one and PR it upstream too, let me know 😉

Copy link

@darioush darioush left a comment

Choose a reason for hiding this comment

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

Let's add a test for the new behavior and remove WithDatabaseStatRecorder if it is unused. Then LGTM

Co-authored-by: Quentin McGaw <[email protected]>
Signed-off-by: Arran Schlosberg <[email protected]>
@qdm12
Copy link

qdm12 commented Feb 3, 2025

and remove WithDatabaseStatRecorder if it is unused

WithDatabaseStatRecorder will be used by coreth 😉 I'll update the coreth branches soon.

@darioush
Copy link

darioush commented Feb 3, 2025

If it's used then let's add the UT

qdm12 and others added 2 commits February 7, 2025 16:06
## Why this should be merged

Add an example test for `InspectDatabase` with options.

## How this works

See example code
Copy link

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Pre-approving to get this merged 🛥️ !

ARR4N and others added 2 commits February 7, 2025 17:16
@ARR4N ARR4N enabled auto-merge (squash) February 7, 2025 17:27
@ARR4N ARR4N merged commit c74b645 into main Feb 7, 2025
4 checks passed
@ARR4N ARR4N deleted the arr4n/rawdb-inspect-stats branch February 7, 2025 17:32
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