예제 #1
0
        public void Setup(OpenAPI.OpenApi api)
        {
            MetricCollectors.Add(new ServerMetrics(Root, api.ServerInfo));


            ReportTimer = new System.Threading.Timer(ReportMetrics, null, 1000, 1000);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public Reporter RegisterMetric(Func <ClrRuntime, Metric> metricCollector)
        {
            MetricCollectors.Add(metricCollector);

            return(this);
        }