bencheeorg / benchee

Easy and extensible benchmarking in Elixir providing you with lots of statistics!
MIT License
1.42k stars 66 forks source link

Add Scenario.data_processed? to simplify checks in formatters #268

Closed PragTob closed 5 years ago

PragTob commented 5 years ago

Formatters often have to check whether run time or memory data was processed - so if data was collected at all and if statistics have already been generated so that they can be rendered.

This should simplify this/not tie all of them to the internal data structure.

The decision as made to check directly on statistics to see if values actually made it into it, rather than just checking the configuration if it was intended to measure, so that we're sure that values are there.

This might sound like a check on Suite to check if all scenarios have all data might be a good thing, however mostly formatters split things by input so it will more often be checked on a sub set of scenarios or individual scenarios.

This PR doesn't use the function in our formatters yet, to avoid merge conflicts with #264 :) #264 will have to adjust its implementation though, but that should be very easy and straight forward.

PragTob commented 5 years ago

PragTob/benchee_html#49 shows how I want this to be used :)

PragTob commented 5 years ago

Needs this for release, know that @devonestes can't make it atm - so will yolo solo merge but would love it if when back @devonestes took a look at it - we're pre 1.0 we can still rename it with the next release :angel: