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

Showcase PR #2

Merged
merged 1 commit into from Aug 11, 2020
Merged

Showcase PR #2

merged 1 commit into from Aug 11, 2020

Conversation

littletof
Copy link
Owner

@littletof littletof commented Jul 31, 2020

This PR is to showcase the capabilities of prettyBenchmarkDown, and the use of Github Actions.

The action that triggers the comment on a PR here

The script that generates the commented markdown here

@github-actions
Copy link

An example benchMarkdown

This markdown was generated with the use of prettyBenchmarkDown, the only things changed, are the code blocks, which were inserted afterwards.
If you use a function for the description or afterTables, you can process the results here as well:

In this benchmark 7 benches were run, 1 were filtered.

Default columns and dynamic text

This is a group's description.
Here you can see what the default columns are, and how you can use a function as description or afterTable inside a group

Name Runs Total (ms) Average (ms)
Sorting arrays 4000 1953.680 0.488
Rotating arrays 1000 3314.176 3.314

This is a group's afterTable.
Here you can access eg. the group name: Default columns and dynamic text, benchmarks in this group: 2 of them here, or the whole BenchmarkRunResult: 7 benchmarks total

Custom columns

Name Runs Total (ms) CustomTotal Formatter Undefined Bad Config
Sorting arrays 4000 1953.680 1953.67963 syarra gnitroS:rettamroF <- - *
Rotating arrays 1000 3314.176 3314.17569 syarra gnitatoR:rettamroF <- - *

If you see -, that means the value there was undefined, if you see * it means that column is badly configured, no formatter or propertyKey was defined.

Predefiend columns

Here you can see, what the predefined columns are.

You can add the indicators and thresholds that you use in prettyBenchmarkProgress and prettyBenchmarkResults.

You can see, how you can rename columns like with Thresholds+

Name Runs Total (ms) Average (ms) Thresholds Thresholds+
Rotating other things 1000 3309.652 3.310 - - -
🎹 Rotating arrays 1000 3314.176 3.314 <= 3.5 ✅
<= 4.4 🔶
> 4.4 🔴
<= 3.5 ✅ 🠴
<= 4.4 🔶 
> 4.4 🔴 
% Proving NP==P 1 5438.598 5438.598 <= 4141 ✅
<= 6000 🔶
> 6000 🔴
<= 4141 ✅ 
<= 6000 🔶 🠴
> 6000 🔴 
🔶
🚀 Standing out 1000 477.289 0.477 <= 0.3 ✅
<= 0.33 🔶
> 0.33 🔴
<= 0.3 ✅ 
<= 0.33 🔶 
> 0.33 🔴 🠴
🔴

Extra metrics

You can add extraMetrics columns too. In its metrics array you can define which columns you want. If you set ignoreSingleRuns to true, it wont show values on rows, where runCount is 1.

Name Runs Total (ms) Average (ms) min max mean median std deviation
Sorting arrays 4000 1953.680 0.488 0.439 9.464 4.951 0.467 0.155
Rotating other things 1000 3309.652 3.310 3.254 5.899 4.577 3.267 0.153
Rotating arrays 1000 3314.176 3.314 3.254 8.209 5.732 3.267 0.197
Proving NP==P 1 5438.598 5438.598 - - - - -
Standing out 1000 477.289 0.477 0.440 1.743 1.091 0.460 0.057

Ungrouped benches

Name Runs Total (ms) Average (ms)
Ungrouped 1 1000 3307.392 3.307
Ungrouped 2 1000 3321.950 3.322

This is the afterTables. This behaves the same as description, it just puts this at the bottom of the markdown.
Here its defined with a simple string.

Check out the Github Action, which comments a markdown like this on PRs: $link

@littletof littletof merged commit 1ba341f into master Aug 11, 2020
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.

None yet

1 participant