コード例 #1
0
        public HistogramResultRow(object groupByKey, TestContextResultAggregate resultsAggregate, List<ResultItemRow> resultItems)
        {
            CreatedThreads = resultsAggregate.CreatedThreadsAvg;
            WorkingThreads = resultsAggregate.WorkingThreadsAvg;

            GroupByKey = groupByKey;
            _resultItems = resultItems;
        }
コード例 #2
0
ファイル: ResultsMapper.cs プロジェクト: Vycka/LoadRunner
        public IEnumerable<ResultItemRow> Map(TestContextResultAggregate results, bool includeAllCheckpoints = false, TimeSpan? aggregationTimeSpan = null)
        {
            IEnumerable<string> resultsOrder = _orderLearner.LearnedOrder;

            List<CheckpointAggregate> orderedResults =
                resultsOrder
                    .Where(results.CheckpointAggregates.ContainsKey)
                    .Select(checkpointName => results.CheckpointAggregates[checkpointName]).ToList();

            if (includeAllCheckpoints)
                yield return
                    new ResultItemRow(results, results.CheckpointAggregates[Checkpoint.IterationSetupCheckpointName], aggregationTimeSpan);

            int iterationCount = 0;
            if (results.CheckpointAggregates.ContainsKey(Checkpoint.IterationEndCheckpointName))
            {
                foreach (CheckpointAggregate resultItem in orderedResults.GetRange(2, orderedResults.Count - 3))
                {
                    var resultItemRow = new ResultItemRow(results, resultItem, aggregationTimeSpan);
                    resultItemRow.SetErrors(orderedResults[1 + iterationCount].Errors);

                    iterationCount++;
                    yield return resultItemRow;
                }
            }
            else if (
                results.CheckpointAggregates.ContainsKey(Checkpoint.IterationStartCheckpointName)
                && results.CheckpointAggregates.ContainsKey(Checkpoint.IterationEndCheckpointName) == false
                )
            {
                foreach (CheckpointAggregate resultItem in orderedResults.GetRange(2, orderedResults.Count - 3))
                {
                    var resultItemRow = new ResultItemRow(results, resultItem, aggregationTimeSpan);
                    resultItemRow.SetErrors(orderedResults[1 + iterationCount].Errors);

                    iterationCount++;
                    yield return resultItemRow;
                }

                ResultItemRow iterationEndRow = new ResultItemRow(
                    Checkpoint.IterationEndCheckpointName,
                    new ResultItemRow(results, orderedResults[orderedResults.Count - 2])
                )
                {
                    Count = 0,
                    SuccessIterationsPerSec = 0
                };

                yield return iterationEndRow;
            }

            if (includeAllCheckpoints)
                yield return
                    new ResultItemRow(results, results.CheckpointAggregates[Checkpoint.IterationTearDownCheckpointName]);
        }
コード例 #3
0
ファイル: ResultItemTotals.cs プロジェクト: Vycka/LoadRunner
        public ResultItemTotals(TestContextResultAggregate results)
        {
            CheckpointAggregate setupRow = results.CheckpointAggregates[Checkpoint.IterationSetupCheckpointName];
            CheckpointAggregate tearDownRow = results.CheckpointAggregates[Checkpoint.IterationTearDownCheckpointName];

            TotalDuration = results.IterationEndTime - results.IterationBeginTime;

            TotalIterationsStartedCount = setupRow.Count;
            TotalFailedIterationCount = results.CheckpointAggregates.Sum(resultItemRow => resultItemRow.Value.Errors.Count) - tearDownRow.Errors.Count;
            TotalSuccessfulIterationCount = TotalIterationsStartedCount - TotalFailedIterationCount;


            _iterationSetupErrors = setupRow.Errors;
            _iterationTearDownErrors = tearDownRow.Errors;

            AverageWorkingThreads = results.WorkingThreadsAvg;
        }
コード例 #4
0
        private TestContextResultAggregate GetHistogramRow(object aggregateSlot)
        {
            TestContextResultAggregate result;
            if (!_histogramItems.TryGetValue(aggregateSlot, out result))
            {
                result = new TestContextResultAggregate();
                _histogramItems.Add(aggregateSlot, result);
            }

            return result;
        }