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")); }
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); }
public LogEventLevelCounter CreateCounter() { var counter = new LogEventLevelCounter(); var newList = new List <LogEventLevelCounter>(); lock (counterLock) { newList.AddRange(counters); newList.Add(counter); counters = newList; } return(counter); }
public LogLevelMetrics(LogEventLevelCounter counter, IMetricContext context) { this.counter = counter; context.CreateMultiFuncGauge(ProvideMetrics); }
private LogLevelMetrics(LogEventLevelCounter counter) { this.counter = counter; }