Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
benchmark: simplify http benchmarker regular expression
A non-capturing group inside a capturing group has no effect. Simplify
the regular expression.

PR-URL: #38206
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
Trott committed Jan 12, 2022
commit 36035e06578bcda0e10cf02d06b7930996d5201a
2 changes: 1 addition & 1 deletion benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class H2LoadBenchmarker {
}

processResults(output) {
const rex = /(\d+(?:\.\d+)) req\/s/;
const rex = /(\d+\.\d+) req\/s/;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe the original intent was to handle integer values? I don't know if that's necessary, please disregard if we know that doesn't happen.

Suggested change
const rex = /(\d+\.\d+) req\/s/;
const rex = /(\d+(?:\.\d+)?) req\/s/;

Copy link
Copy Markdown
Member

@ErickWendel ErickWendel Jan 10, 2022

Choose a reason for hiding this comment

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

I think it shouldn't work with integers. The h2load output is something like "finished in 233.18s, 0.43 req/s, 105B/s" his docs

return rex.exec(output)[1];
}
}
Expand Down