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));