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

feat(invariant): add basic metrics report #9158

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Oct 22, 2024

Motivation

Closes #3607 with basic approach #3607 (comment) (more complex impl to be looked up post 1.0 release)

  • display a table with invariant fuzzed selectors and metrics under each invariant test (if run with show_metrics invariant config, inline or global, on true) as
    image

Solution

  • add InvariantMetrics struct and update during invariant runs: holds total number of calls, discarded runs (through vm.assume) and reverts per selector
  • add helper fn to create and print metrics table

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool

Copy link
Member

@yash-atreya yash-atreya left a comment

Choose a reason for hiding this comment

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

lgtm!

@yash-atreya yash-atreya merged commit c2f1760 into foundry-rs:master Oct 24, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(forge): Add internal metrics capability
3 participants