Ejemplo n.º 1
0
        /// <summary>
        /// Counters only increase in value and reset to zero when the process restarts.
        /// </summary>
        public Counter CreateCounter(string name, string help, CounterConfiguration configuration = null)
        {
            configuration = configuration ?? CounterConfiguration.Default;

            var metric = new Counter(name, help, configuration.LabelNames, configuration.SuppressInitialValue);

            return((Counter)_registry.GetOrAdd(metric));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Counters only increase in value and reset to zero when the process restarts.
 /// </summary>
 public Counter CreateCounter(string name, string help, CounterConfiguration?configuration = null)
 {
     return(_registry.GetOrAdd(new CollectorRegistry.CollectorInitializer <Counter, CounterConfiguration>(
                                   (n, h, config) => new Counter(n, h, config.LabelNames, config.SuppressInitialValue),
                                   name, help, configuration ?? CounterConfiguration.Default)));
 }