public static InsertMetrics sum(InsertMetrics m1, InsertMetrics m2) {
        long totalDocsInserted = m1.numberOfDocumentsInserted + m2.numberOfDocumentsInserted;
        Duration totalTimeTaken = m1.timeTaken.plus(m2.timeTaken);
        double totalRequestUnitsConsumed = m1.requestUnitsConsumed + m2.requestUnitsConsumed;
        long totalNumberOfThrottles = m1.numberOfThrottles + m2.numberOfThrottles;

        return new InsertMetrics(totalDocsInserted, totalTimeTaken, totalRequestUnitsConsumed, totalNumberOfThrottles);
    }
public static InsertMetrics sum ( InsertMetrics m1 , InsertMetrics m2 ) { long totalDocsInserted = m1 . numberOfDocumentsInserted + m2 . numberOfDocumentsInserted ; Duration totalTimeTaken = m1 . timeTaken . plus ( m2 . timeTaken ) ; double totalRequestUnitsConsumed = m1 . requestUnitsConsumed + m2 . requestUnitsConsumed ; long totalNumberOfThrottles = m1 . numberOfThrottles + m2 . numberOfThrottles ; return new InsertMetrics ( totalDocsInserted , totalTimeTaken , totalRequestUnitsConsumed , totalNumberOfThrottles ) ; }
Sums two {@link InsertMetrics} instances
@param m1
@param m2
@return the sum aggregate result