-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Hi. I've lost a couple of hours now trying to coax BenchmarkDotNet to output hardware counters in a XML or JSON file. Default job configuration outputs them in the console report and CSV file, but not matter what I do (even following CSV export example), I run into the following troubles:
- The HW counters are missing in the XML or JSON file, but present in the CSV output
- Configuring CSV exporter to write machine-readable output (as below) does not work; i get units in values columns
HW counters DO get shown in the console summary.
Any suggestions?
Sample code:
// In main: var summaries = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(config: new CustomConfig());
internal class CustomConfig : ManualConfig
{
public CustomConfig() {
AddJob(Job.Default);
AddLogger(BenchmarkDotNet.Loggers.ConsoleLogger.Default);
AddColumn(BenchmarkDotNet.Columns.)
AddExporter(new CsvExporter(
CsvSeparator.CurrentCulture,
new SummaryStyle(
cultureInfo: System.Globalization.CultureInfo.InvariantCulture,
printUnitsInHeader: true,
printUnitsInContent: false,
timeUnit: Perfolizer.Horology.TimeUnit.Millisecond,
sizeUnit: BenchmarkDotNet.Columns.SizeUnit.KB)));
AddHardwareCounters(HardwareCounter.TotalIssues, HardwareCounter.CacheMisses, HardwareCounter.BranchInstructions, HardwareCounter.BranchMispredictions);
}
}