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/test/java/org/elasticsearch/xpack/analytics/rate/TimeSeriesRateAggregatorTests.java
iw.addDocuments(docs(1000, "2", 74, 150,  50, 90,  40));
        }, verifier, aggTestConfig);
    }
    public void testNestedWithinDateHistogram() throws IOException {
        RateAggregationBuilder builder = new RateAggregationBuilder("counter_field").field("counter_field");
        DateHistogramAggregationBuilder dateBuilder = new DateHistogramAggregationBuilder("date");
        dateBuilder.field("@timestamp");
        dateBuilder.fixedInterval(DateHistogramInterval.seconds(2));
        dateBuilder.subAggregation(builder);
        TimeSeriesAggregationBuilder tsBuilder = new TimeSeriesAggregationBuilder("tsid");
        tsBuilder.subAggregation(dateBuilder);
        Consumer<InternalTimeSeries> verifier = r -> {
            assertThat(r.getBuckets(), hasSize(2));
            assertThat(r.getBucketByKey("{dim=1}"), instanceOf(InternalTimeSeries.InternalBucket.class));
            InternalDateHistogram hb = r.getBucketByKey("{dim=1}").getAggregations().get("date");
            {
                Rate rate = hb.getBuckets().get(1).getAggregations().get("counter_field");
                assertThat(rate.getValue(), closeTo((60 - 37 + 14) / 2000.0, 0.00001));
            }
            {
                Rate rate = hb.getBuckets().get(0).getAggregations().get("counter_field");
                assertThat(rate.getValue(), closeTo((37 - 15) / 1000.0, 0.00001));
            }
            hb = r.getBucketByKey("{dim=2}").getAggregations().get("date");
            {
                Rate rate = hb.getBuckets().get(0).getAggregations().get("counter_field");
                assertThat(rate.getValue(), closeTo((150 - 74) / 1000.0, 0.00001));
            }
            {
                Rate rate = hb.getBuckets().get(1).getAggregations().get("counter_field");