public SampleFamily rate(String range) {
        Preconditions.checkArgument(!Strings.isNullOrEmpty(range));
        if (this == EMPTY) {
            return EMPTY;
        }
        return SampleFamily.build(
            this.context,
            Arrays.stream(samples)
                  .map(sample -> sample.increase(
                      range,
                      context.metricName,
                      (lowerBoundValue, lowerBoundTime) -> {
                          final long timeDiff = (sample.timestamp - lowerBoundTime) / 1000;
                          return timeDiff < 1L ? 0.0 : (sample.value - lowerBoundValue) / timeDiff;
                      }
                  ))
                  .toArray(Sample[]::new)
        );
    }
Following operations are used in DSL
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/dsl/SampleFamily.java