internal ClientStatisticsManager(ClientConfiguration config) { this.config = config; runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); logger = LogManager.GetLogger(GetType().Name); MessagingStatisticsGroup.Init(false); NetworkingStatisticsGroup.Init(false); ApplicationRequestsStatisticsGroup.Init(config.ResponseTimeout); }
public ClientStatisticsManager( ClientConfiguration config, SerializationManager serializationManager, IServiceProvider serviceProvider, IHostEnvironmentStatistics hostEnvironmentStatistics, IAppEnvironmentStatistics appEnvironmentStatistics, ILoggerFactory loggerFactory, IOptions <ClientStatisticsOptions> statisticsOptions, IOptions <ClusterClientOptions> clusterClientOptions) { this.config = config; this.statisticsOptions = statisticsOptions.Value; this.serviceProvider = serviceProvider; this.hostEnvironmentStatistics = hostEnvironmentStatistics; this.appEnvironmentStatistics = appEnvironmentStatistics; this.clusterClientOptions = clusterClientOptions.Value; logStatistics = new LogStatistics(this.statisticsOptions.LogWriteInterval, false, serializationManager, loggerFactory); logger = loggerFactory.CreateLogger <ClientStatisticsManager>(); this.loggerFactory = loggerFactory; MessagingStatisticsGroup.Init(false); NetworkingStatisticsGroup.Init(false); ApplicationRequestsStatisticsGroup.Init(config.ResponseTimeout); }
internal void Stop() { if (runtimeStats != null) { runtimeStats.Stop(); } runtimeStats = null; if (logStatistics != null) { logStatistics.Stop(); logStatistics.DumpCounters().WaitWithThrow(TimeSpan.FromSeconds(10)); } logStatistics = null; if (tableStatistics != null) { tableStatistics.Dispose(); } tableStatistics = null; }
public void Logger_Stats_MessageSizeLimit() { const string testName = "Logger_Stats_MessageSizeLimit"; TestLogConsumer logConsumer = new TestLogConsumer(); TraceLogger.LogConsumers.Add(logConsumer); TraceLogger logger1 = TraceLogger.GetLogger(testName); const string StatsCounterBaseName = "LoggerTest.Stats.Size"; for (int i = 1; i <= 1000; i++) { StatisticName counterName = new StatisticName(StatsCounterBaseName + "." + i); CounterStatistic ctr = CounterStatistic.FindOrCreate(counterName); ctr.IncrementBy(i); } LogStatistics statsLogger = new LogStatistics(TimeSpan.Zero, true); statsLogger.DumpCounters().Wait(); int count = logConsumer.GetEntryCount((int)ErrorCode.PerfCounterDumpAll); Console.WriteLine(count + " stats log message entries written"); Assert.IsTrue(count > 1, "Should be some stats log message entries - saw " + count); Assert.AreEqual(0, logConsumer.GetEntryCount((int)ErrorCode.Logger_LogMessageTruncated), "Should not see any 'Message truncated' message"); }
internal ClientStatisticsManager(IStatisticsConfiguration config) { runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); }
internal ClientStatisticsManager(IStatisticsConfiguration config) { runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); logger = TraceLogger.GetLogger(GetType().Name); }
internal void Stop() { if (runtimeStats != null) runtimeStats.Stop(); runtimeStats = null; if (logStatistics != null) { logStatistics.Stop(); logStatistics.DumpCounters().WaitWithThrow(TimeSpan.FromSeconds(10)); } logStatistics = null; if (tableStatistics != null) tableStatistics.Dispose(); tableStatistics = null; }
public void Dispose() { if (runtimeStats != null) runtimeStats.Dispose(); runtimeStats = null; if (logStatistics != null) logStatistics.Dispose(); logStatistics = null; }
internal ClientStatisticsManager(IStatisticsConfiguration config) { runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); logger = TraceLogger.GetLogger(GetType().Name); }