BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Feature Request: allow to extend and/or parametrize RPlotExporter, or at least specify custom R script

Open NinjaCross opened this issue 1 year ago • 3 comments

The current implementation (v0.14.0) of RPlotExporter (src/BenchmarkDotNet/Exporters/RPlotExporter.cs) works OK and IMHO is nicely implemented, but lacks for flexibility, because:

  1. almost all methods are non-virtual and/or static
  2. depends on internal dependencies (i.e. IExporterDependencies, RuntimeInformation, ExporterBase.GetArtifactFullName, and AsyncProcessOutputReader)
  3. doesn't allow to specify a custom R script (since it's loaded from the assembly resources BenchmarkDotNet)

This greately limits the usability of such wonderfull feature. I propose to:

  1. Allow to parametrize the file name/path of the R script, so that one can create its own and use it as desired
  2. Slightly change the way that the class RPlotExporter is implemented, so that it can be easily inherited and customized by overriding some methods
  3. Make IExporterDependencies, RuntimeInformation, and AsyncProcessOutputReader as public instead of internal, so that they can be referred by inherited classes and other custom-made exporters

I'm available to prepare a PR, if the proposal is deemed usefull.

NinjaCross avatar Aug 20 '24 08:08 NinjaCross