Skip to content

Commit

Permalink
Merge pull request #34 from max-au/erlperf/verbose-dump-code
Browse files Browse the repository at this point in the history
[erlperf] Dump generated code in verbose mode
  • Loading branch information
max-au authored Apr 14, 2024
2 parents ae4ee23 + f86e214 commit 93509bc
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 68 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.2.2
- added generated source code output in verbose mode

## 2.2.1
- tested with OTP 26 and 27
- updated to argparse 2.0.0
Expand Down
32 changes: 16 additions & 16 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ erlperf [FLAG] runner [INIT] [INIT_RUNNER] [DONE] [runner...]

## Flags

| Short | Long | Description |
|-------|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -c | --concurrency | Specifies the number of workers per job. Allowed only in continuous mode |
| | --cv | Coefficient of variation. Accepted in continuous and concurrency estimation mode. Benchmark keeps running until standard deviation is below the specified number |
| -i | --isolation | Requests to run every benchmark in a separate Erlang VM for isolation purposes |
| -s | --samples | Number of samples to take. Defaults to 1 for timed mode, 3 for continuous and concurrency estimation |
| -d | --sample_duration | Sample duration, in milliseconds, for continuous and concurrency estimation modes |
| -l | --loop | Sample duration (iterations) for the timed mode. Engages timed mode when specified |
| | --max | Maximum number of workers allowed in the concurrency estimation mode |
| | --min | Starting number of workers in concurrency estimation mode |
| -pa | | Adds extra code path to the Erlang VM. Useful for benchmarking *.beam files on your filesystem |
| -r | --report | Requests `basic`, `extended` or `full` report. Defaults to `basic` when less than 10 samples are requested, and `extended` for 10 and more |
| -q | -squeeze | Engages concurrency estimation mode |
| -t | -threshold | Sets number of extra workers to try in concurrency estimation mode before concluding the test |
| -v | --verbose | Turns on verbose logging (VM statistics and performance of continuous jobs) |
| -w | --warmup | Warmup |
| Short | Long | Description |
|-------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -c | --concurrency | Specifies the number of workers per job. Allowed only in continuous mode |
| | --cv | Coefficient of variation. Accepted in continuous and concurrency estimation mode. Benchmark keeps running until standard deviation is below the specified number |
| -i | --isolation | Requests to run every benchmark in a separate Erlang VM for isolation purposes |
| -s | --samples | Number of samples to take. Defaults to 1 for timed mode, 3 for continuous and concurrency estimation |
| -d | --sample_duration | Sample duration, in milliseconds, for continuous and concurrency estimation modes |
| -l | --loop | Sample duration (iterations) for the timed mode. Engages timed mode when specified |
| | --max | Maximum number of workers allowed in the concurrency estimation mode |
| | --min | Starting number of workers in concurrency estimation mode |
| -pa | | Adds extra code path to the Erlang VM. Useful for benchmarking *.beam files on your filesystem |
| -r | --report | Requests `basic`, `extended` or `full` report. Defaults to `basic` when less than 10 samples are requested, and `extended` for 10 and more |
| -q | -squeeze | Engages concurrency estimation mode |
| -t | -threshold | Sets number of extra workers to try in concurrency estimation mode before concluding the test |
| -v | --verbose | Turns on verbose mode, including generated source code, VM statistics and performance of continuous jobs) |
| -w | --warmup | Warmup |

## Benchmark code
At least one runner code is required. Specify multiple runner codes to perform
Expand Down
2 changes: 1 addition & 1 deletion src/erlperf.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, erlperf,
[{description, "Erlang Performance & Benchmarking Suite"},
{vsn, "2.2.1"},
{vsn, "2.2.2"},
{registered, [
erlperf_sup, erlperf_job_sup, erlperf_monitor,
erlperf_history, erlperf_file_log, erlperf_cluster_monitor
Expand Down
5 changes: 5 additions & 0 deletions src/erlperf_cli.erl
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ determine_mode(ParsedOpts) ->
benchmark(Codes, RunOpts, ConcurrencyTestOpts, false) ->
erlperf:benchmark(Codes, RunOpts, ConcurrencyTestOpts);
benchmark(Codes, RunOpts, ConcurrencyTestOpts, true) ->
[begin
io:format(">>>>>>>>>>>>>>> ~-32ts ~n", [format_code(maps:get(runner, C))]),
[io:format("~ts~n", [L]) || L <- erlperf_job:source(C)],
io:format("<<<<<<<<<<<<<<< ~n")
end|| C <- Codes],
{ok, Pg} = pg:start_link(erlperf),
{ok, Monitor} = erlperf_monitor:start_link(),
{ok, Logger} = erlperf_file_log:start_link(),
Expand Down
Loading

0 comments on commit 93509bc

Please sign in to comment.