public IEnumerable<HistogramResultRow> GetResults()
{
if (_orderLearner.LearnedOrder.Count != 0)
{
TimeSpan lastAggregationBeginMark = TimeSpan.MinValue;
if (AggregationTimePeriod != null)
{
TimeSpan lastIterationBeginMark = _histogramItems.Max(h => h.Value.IterationBeginTime);
lastAggregationBeginMark = TimeSpan.FromTicks(
(lastIterationBeginMark.Ticks / AggregationTimePeriod.Value.Ticks)
* AggregationTimePeriod.Value.Ticks
);
}
ResultsMapper mapper = new ResultsMapper(_orderLearner);
foreach (KeyValuePair<object, TestContextResultAggregate> histogramItem in _histogramItems)
{
HistogramResultRow result = new HistogramResultRow(
histogramItem.Key,
histogramItem.Value,
mapper.Map(histogramItem.Value, true, histogramItem.Value.IterationBeginTime >= lastAggregationBeginMark ? null : AggregationTimePeriod).ToList()
);
yield return result;
}
}
}