Skip to content
Giovanni Caniato edited this page Dec 3, 2018 · 1 revision

The Metrics.NET library provides the following out of the box implementations for reporting or visualizing metrics:

Console Report

Schedule a console report to be run and displayed every 10 seconds:

Metric.Config.WithReporting(report => report
    .WithConsoleReport(TimeSpan.FromSeconds(30)));

CSV File Report

Schedule a line to be appended for each metric to a csv file:

Metric.Config.WithReporting(report => report
    .WithCSVReports(@"c:\temp\reports\", TimeSpan.FromSeconds(10)));

Human Readable text file

Schedule a human readable text version of the current metrics to be written to a file every 1 minute:

Metric.Config.WithReporting(report => report
    .WithTextFileReport(@"C:\temp\reports\metrics.txt", TimeSpan.FromMinutes(1)));