private void LogWhenBufferFull() { if (_logs.Count >= Buffer) { _logger.Log(new PlcPerformanceData(_identifier, _logs.ToArray())); _logs = new List <long>(Buffer); } }
public void Test() { var logger = new PerformanceLogger <PerformanceData>("unittests"); var rnd = new Random(); var dataValue = new [] { "Action 1", "Action 2", "Action 3" }; foreach (var i in Enumerable.Range(0, 10)) { var performanceData = new PerformanceData(dataValue[i % 3], (float)rnd.NextDouble()); logger.Log(performanceData); Thread.Sleep(rnd.Next(0, 10)); } Thread.Sleep(100); }