Currently when using `unit` parameter in the `rate` aggregator in time series mode (meaning the `rate` aggregation is defined as a child aggregation of `time_series` aggregation) then this parameter is ignored. We should investigate whether this parameter can be supported for computing rate in time series mode.
x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalResetTrackingRate.java
}
    @Override
    public String getWriteableName() {
        return NAME;
    }
    @Override
    protected void doWriteTo(StreamOutput out) throws IOException {
        out.writeDouble(startValue);
        out.writeDouble(endValue);
        out.writeLong(startTime);
        out.writeLong(endTime);
        out.writeDouble(resetCompensation);
    }
    @Override
    public InternalAggregation reduce(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) {
        List<InternalResetTrackingRate> toReduce = aggregations.stream()
            .map(r -> (InternalResetTrackingRate) r)
            .sorted(Comparator.comparingLong(o -> o.startTime))
            .toList();
        double resetComp = toReduce.get(0).resetCompensation;
        double startValue = toReduce.get(0).startValue;
        double endValue = toReduce.get(0).endValue;
        final int endIndex = toReduce.size() - 1;
        for (int i = 1; i < endIndex + 1; i++) {
            InternalResetTrackingRate rate = toReduce.get(i);
            assert rate.startTime >= toReduce.get(i - 1).endTime;
            resetComp += rate.resetCompensation;
            if (endValue > rate.startValue) {
                resetComp += endValue;
            }