Пример #1
0
 public RunResults([CanBeNull] IReadOnlyList <Measurement> overhead,
                   [NotNull] IReadOnlyList <Measurement> workload,
                   OutlierMode outlierMode,
                   GcStats gcStats,
                   ThreadingStats threadingStats)
 {
     this.outlierMode = outlierMode;
     Overhead         = overhead;
     Workload         = workload;
     GCStats          = gcStats;
     ThreadingStats   = threadingStats;
 }
Пример #2
0
        private (GcStats, ThreadingStats) GetExtraStats(IterationData data)
        {
            // we enable monitoring after main target run, for this single iteration which is executed at the end
            // so even if we enable AppDomain monitoring in separate process
            // it does not matter, because we have already obtained the results!
            EnableMonitoring();

            IterationSetupAction();                                   // we run iteration setup first, so even if it allocates, it is not included in the results

            var initialThreadingStats = ThreadingStats.ReadInitial(); // this method might allocate
            var initialGcStats        = GcStats.ReadInitial();

            WorkloadAction(data.InvokeCount / data.UnrollFactor);

            var finalGcStats        = GcStats.ReadFinal();
            var finalThreadingStats = ThreadingStats.ReadFinal();

            IterationCleanupAction(); // we run iteration cleanup after collecting GC stats

            GcStats        gcStats        = (finalGcStats - initialGcStats).WithTotalOperations(data.InvokeCount * OperationsPerInvoke);
            ThreadingStats threadingStats = (finalThreadingStats - initialThreadingStats).WithTotalOperations(data.InvokeCount * OperationsPerInvoke);

            return(gcStats, threadingStats);
        }