Exemplo n.º 1
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="registry">Collector registry</param>
        /// <param name="collectors">IOnDemandCollectors</param>
        /// <param name="useDefaultCollectors">Use default collectors</param>
        protected BaseMetricServer(ICollectorRegistry registry, List <IOnDemandCollector> collectors, bool useDefaultCollectors)
        {
            Registry = registry ?? CollectorRegistry.Instance;
            if (useDefaultCollectors)
            {
                var metricFactory = Registry == CollectorRegistry.Instance
                    ? Metrics.DefaultFactory
                    : new MetricFactory(Registry);

                collectors.AddRange(DefaultCollectors.Get(metricFactory));
            }

            Registry.RegisterOnDemandCollectors(collectors);
        }
Exemplo n.º 2
0
 public void AddDefaultCollector(string name)
 {
     DefaultCollectors.Add(name, true);
 }
Exemplo n.º 3
0
 public void ClearDefaultCollectors()
 {
     DefaultCollectors.Clear();
 }