protected StatsAggregator(int id, IStatsAggregator lastStats) { Id = id; var now = SystemTime.UtcNow; var currentScope = lastStats?.StatsScope; if (currentScope == null) { StartTime = now; } else { var lastCompleted = lastStats.StartTime.Add(currentScope.Duration); // due to different precision of DateTimes and Stopwatches we might have current date // smaller than completed one of the latest batch // let us adjust current start to avoid overlapping on the performance graph StartTime = lastCompleted > now ? lastCompleted : now; } Stats = new TStats(); }
public virtual void Visit(IStatsAggregator aggregation) { }