@Override
    public final void calculate() {
        long result = this.summation / this.count;
        // The minimum of avg result is 1, that means once there's some data in a duration user can get "1" instead of
        // "0".
        if (result == 0 && this.summation > 0) {
            result = 1;
        }
        this.value = result;
    }
Service ID is required for sort query.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/function/avg/AvgFunction.java