public void Setup(OpenAPI.OpenApi api) { MetricCollectors.Add(new ServerMetrics(Root, api.ServerInfo)); ReportTimer = new System.Threading.Timer(ReportMetrics, null, 1000, 1000); }
public Report Report(ClrRuntime runtime) { var report = new Report(); report.Stats = StatCollectors .Select(s => s(runtime)) .ToList(); report.Metrics = MetricCollectors .Select(m => m(runtime)) .Concat(MultiMetricCollectors .SelectMany(c => c(runtime))) .ToList(); report.Issues = Detectors.SelectMany(d => d(runtime, report)).ToList(); return(report); }
public Reporter RegisterMetric(Func <ClrRuntime, Metric> metricCollector) { MetricCollectors.Add(metricCollector); return(this); }