Viki.LoadRunner.Engine.Aggregators.HistogramResultsAggregator.GetResults C# (CSharp) Method

GetResults() public method

Build results object from aggregated data
public GetResults ( ) : IEnumerable
return IEnumerable
        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;
                }
            }
        }

Usage Example

 /// <summary>
 /// Get Build results object from aggregated data
 /// </summary>
 /// <returns>Aggregated results</returns>
 public IEnumerable <HistogramResultRow> GetResults()
 {
     return(_histogramResultsAggregator.GetResults());
 }