コード例 #1
0
 public static void Measure(LogEventLevelCounter counter, IVostokApplicationMetrics context)
 {
     // ReSharper disable once ObjectCreationAsStatement
     new LogLevelMetrics(
         counter,
         context.Instance
         .WithTag(WellKnownTagKeys.Component, "VostokLog")
         .WithTag(WellKnownTagKeys.Name, "EventsByLevel"));
 }
コード例 #2
0
 public static IDisposable Measure(LogEventLevelCounter counter, IVostokApplicationMetrics context)
 {
     return(context.Instance
            .WithTag(WellKnownTagKeys.Component, "VostokLog")
            .WithTag(WellKnownTagKeys.Name, "EventsByLevel")
            .CreateMultiFuncGauge(new LogLevelMetrics(counter).ProvideMetrics, new FuncGaugeConfig {
         ScrapeOnDispose = true
     })
            as IDisposable);
 }
コード例 #3
0
        public LogEventLevelCounter CreateCounter()
        {
            var counter = new LogEventLevelCounter();
            var newList = new List <LogEventLevelCounter>();

            lock (counterLock)
            {
                newList.AddRange(counters);
                newList.Add(counter);
                counters = newList;
            }

            return(counter);
        }
コード例 #4
0
        public LogLevelMetrics(LogEventLevelCounter counter, IMetricContext context)
        {
            this.counter = counter;

            context.CreateMultiFuncGauge(ProvideMetrics);
        }
コード例 #5
0
 private LogLevelMetrics(LogEventLevelCounter counter)
 {
     this.counter = counter;
 }