presto-main/src/main/java/io/prestosql/operator/ExchangeClientStatus.java/ExchangeClientStatus/mergeAvgs
class ExchangeClientStatus:    private static long mergeAvgs(long value1, long count1, long value2, long count2)
    {
        if (count1 == 0) {
            return value2;
        }
        if (count2 == 0) {
            return value1;
        }
        // AVG_n+m = AVG_n * n / (n + m) + AVG_m * m / (n + m)
        return (value1 * count1 / (count1 + count2)) + (value2 * count2 / (count1 + count2));
    }