private void Setup(ITraceHistory history) { var start = DateTime.Now.AddSeconds(-HistorySize); for (var timeIndex = 0; timeIndex < HistorySize; timeIndex++) { var time = start.AddSeconds(timeIndex); AddTraceData(time, history); } }
private void AddTraceData(DateTime time, ITraceHistory history) { for (var siloIndex = 0; siloIndex < SiloCount; siloIndex++) { var trace = new List <SiloGrainTraceEntry>(); for (var grainIndex = 0; grainIndex < GrainTypeCount; grainIndex++) { for (var grainMethodIndex = 0; grainMethodIndex < GrainMethodCount; grainMethodIndex++) { trace.Add(new SiloGrainTraceEntry { ElapsedTime = 10, Count = 100, Method = $"METHOD_{grainMethodIndex}", Grain = $"GRAIN_{grainIndex}", ExceptionCount = 0 }); } } history.Add(time, $"SILO_{siloIndex}", trace.ToArray()); } }
void Add(ITraceHistory history, int count) { for (var i = 0; i < count; i++) { history.Add(startTime.AddSeconds(seconds), "SILO1", new[] { new SiloGrainTraceEntry { Grain = "GRAIN1", Method = "METHOD1", Count = 1, ExceptionCount = 0, ElapsedTime = 10 } }); history.Add(startTime.AddSeconds(seconds), "SILO2", new[] { new SiloGrainTraceEntry { Grain = "GRAIN1", Method = "METHOD1", Count = 100, ExceptionCount = 10, ElapsedTime = 200 } }); seconds++; } }