benchttp/runner

Implement output template

Closed this issue · 0 comments

Description

With #59, the runner can be integrated in a CI by reading the summary in stdout.
It's an interesting use case, but not ideal for 2 reason:

  1. some convenience prints add noise to the output
  2. extracting a specific information form the default summary can be tedious, and it might not even contain the desired information

Here we want to address point 2 by allowing users to shape the CLI output the way they want using a new config option output.template. It should give access to any value from output.Output, and the result should override the default summary.

Tasks

  • Define new config field output.template and update CLI and file parsers accordingly as well as unit tests. Expected value is a string containing a valid Go's text/template syntax.
  • Optional: perform syntax validation before the run in config.Global.Validate
  • Implement template execution in output with output.Output for model.
  • Optional: leverage access to computed data (min, max, mean durations, others?) that are not natively accessible via output.Output

Suggestions

Notes

  • Blocked by #59