Metrics.NET类库提供了以下几种开箱即用的报表或指标可视化的实现:
###让控制台输出每30秒执行并显示:
Metric.Config.WithReporting(report => report
.WithConsoleReport(TimeSpan.FromSeconds(30));
###CSV文件报告计划,每个指标添加一行到csv文件:
Metric.Config.WithReporting(report => report
.WithCSVReports(@"c:\temp\reports\", TimeSpan.FromSeconds(10));
###人可读的文本文件计划:以每1分钟一次的频度将当前指标的可读文本报告写入文件
Metric.Config.WithReporting(report => report
.WithTextFileReport(@"C:\temp\reports\metrics.txt", TimeSpan.FromMinutes(1));