Esempio n. 1
0
 public AggregatePerformanceMeasurments Aggregate(PerformanceMeasurments other)
 {
     return new AggregatePerformanceMeasurments()
     {
         ExecutionTime = ExecutionTime + other.ExecutionTime,
         OpsExecuted = OpsExecuted + other.OpsExecuted,
         StatementsExecutedByScope = StatementsExecutedByScope
                                     .Concat(other.StatementsExecutedByScope)
                                     .GroupBy(x => x.Key)
                                     .ToDictionary(x => x.Key, y => y.Sum(z => z.Value)),
         Executions = Executions + ((other is AggregatePerformanceMeasurments) ? ((AggregatePerformanceMeasurments)other).Executions : 1),
         StatementsExecuted = StatementsExecuted
                                     .Concat(other.StatementsExecuted)
                                     .GroupBy(x => x.Key)
                                     .ToDictionary(x => x.Key, x => x.Sum(y=> y.Value))
     };
 }
Esempio n. 2
0
 public AggregatePerformanceMeasurments Aggregate(PerformanceMeasurments other)
 {
     return(new AggregatePerformanceMeasurments()
     {
         ExecutionTime = ExecutionTime + other.ExecutionTime,
         OpsExecuted = OpsExecuted + other.OpsExecuted,
         StatementsExecutedByScope = StatementsExecutedByScope
                                     .Concat(other.StatementsExecutedByScope)
                                     .GroupBy(x => x.Key)
                                     .ToDictionary(x => x.Key, y => y.Sum(z => z.Value)),
         Executions = Executions + ((other is AggregatePerformanceMeasurments) ? ((AggregatePerformanceMeasurments)other).Executions : 1),
         StatementsExecuted = StatementsExecuted
                              .Concat(other.StatementsExecuted)
                              .GroupBy(x => x.Key)
                              .ToDictionary(x => x.Key, x => x.Sum(y => y.Value))
     });
 }