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

@grandizzy grandizzy marked this pull request as ready for review October 22, 2024 14:39
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
rplusq pushed a commit to rplusq/foundry that referenced this pull request Nov 29, 2024
* feat(invariant): add basic metrics report

* Put metrics behind show-metrics invariant config
@grandizzy grandizzy added T-feature Type: feature C-forge Command: forge labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-feature Type: feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat(forge): Add internal metrics capability
3 participants