Esempio n. 1
0
        public MetricsConfig(IConfiguration config, bool enabledDefault = true)
        {
            this.Enabled         = config.GetValue("MetricsEnabled", enabledDefault);
            this.HistogramMaxAge = config.GetValue("MetricsHistogramMaxAge", TimeSpan.FromHours(1));

            this.ListenerConfig = MetricsListenerConfig.Create(config);
        }
Esempio n. 2
0
        public static MetricsConfig Create(IConfiguration config)
        {
            bool enabled = config.GetValue("enabled", false);
            MetricsListenerConfig listenerConfig = enabled
                ? MetricsListenerConfig.Create(config.GetSection("listener"))
                : new MetricsListenerConfig();

            return(new MetricsConfig(enabled, listenerConfig));
        }
Esempio n. 3
0
 public MetricsConfig(IConfiguration config, bool enabledDefault = true)
 {
     this.Enabled        = config.GetValue("MetricsEnabled", enabledDefault);
     this.ListenerConfig = MetricsListenerConfig.Create(config);
 }