Ejemplo n.º 1
0
        /// <inheritdoc/>
        public IEnumerable <Collector> Provide(IMetricFactory metricFactory)
        {
            _connectedHeads  = metricFactory.Gauge("ConnectedHeads", "Number of connected heads");
            _headConnects    = metricFactory.Counter("HeadConnects", "Number of connections established from heads");
            _headDisconnects = metricFactory.Counter("HeadDisconnects", "Number of connections disconnected from heads");

            return(new Collector[]
            {
                _connectedHeads,
                _headConnects,
                _headDisconnects
            });
        }
Ejemplo n.º 2
0
        public static ICounter Counter(string name, string instance)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (String.IsNullOrEmpty(instance))
            {
                throw new ArgumentNullException(nameof(instance));
            }

            var parent = New(name, null, () => Factory.Counter(name));

            return(New(name, instance, () => Factory.Counter(parent, instance)));
        }