public Dictionary <string, StatusReportingMeanCounter> GetMeanCountsInPeriod(IDictionary <string, StatusReportingMeanCounter> InCounters) { Dictionary <string, StatusReportingMeanCounter> CountsInPeriod = new Dictionary <string, StatusReportingMeanCounter>(); foreach (var Counter in InCounters) { StatusReportingMeanCounter LastCount; if (!MeanCountersAtLastReport.TryGetValue(Counter.Key, out LastCount)) { LastCount = new StatusReportingMeanCounter(); MeanCountersAtLastReport.Add(Counter.Key, LastCount); } CountsInPeriod.Add(Counter.Key, new StatusReportingMeanCounter(LastCount, Counter.Value)); LastCount.SampleCount = Counter.Value.SampleCount; LastCount.TotalMillisec = Counter.Value.TotalMillisec; } return(CountsInPeriod); }
public StatusReportingMeanCounter(StatusReportingMeanCounter LastPeriod, StatusReportingMeanCounter Total) { TotalMillisec = Total.TotalMillisec - LastPeriod.TotalMillisec; SampleCount = Total.SampleCount - LastPeriod.SampleCount; }