public SampleFamily histogram(String le, TimeUnit unit) {
        long scale = unit.toMillis(1);
        Preconditions.checkArgument(scale > 0);
        ExpressionParsingContext.get().ifPresent(ctx -> ctx.isHistogram = true);
        if (this == EMPTY) {
            return EMPTY;
        }
        return SampleFamily.build(
            this.context,
            Stream.concat(
                Arrays.stream(samples).filter(s -> !s.labels.containsKey(le)),
                Arrays.stream(samples)
                      .filter(s -> s.labels.containsKey(le))
                      .sorted(Comparator.comparingDouble(s -> Double.parseDouble(s.labels.get(le))))
                      .map(s -> {
                          double r = s.value;
                          ImmutableMap<String, String> ll = ImmutableMap.<String, String>builder()
                                                                        .putAll(Maps.filterKeys(s.labels,
                                                                                                key -> !Objects.equals(
                                                                                                    key, le)
                                                                        ))
                                                                        .put(
                                                                            "le",
                                                                            String.valueOf((long) ((Double.parseDouble(s.labels.get(le))) * scale)))
                                                                        .build();
                          return InternalOps.newSample(s.name, ll, s.timestamp, r);
                      })
            ).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