public MetricsConfig(MetricsContext context) { this.context = context; if (!globalyDisabled) { this.healthStatus = () => HealthChecks.GetStatus(); this.reports = new MetricsReports(this.context.DataProvider, this.healthStatus); this.context.Advanced.ContextDisabled += (s, e) => { this.isDisabled |= true; this.DisableAllReports(); }; } }
internal MetricsConfig() { this.registry = new Lazy <MetricsRegistry>(() => new LocalRegistry(), true); this.healthStatus = () => HealthChecks.GetStatus(); this.reports = new Lazy <MetricsReports>(() => new MetricsReports(this.Registry, this.HealthStatus)); }