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
assertThat(rate.getValue(), closeTo(90 / 2000.0, 0.00001));
            }
        };
        AggTestConfig aggTestConfig = new AggTestConfig(tsBuilder, timeStampField(), counterField("counter_field"))
            .withSplitLeavesIntoSeperateAggregators(false);
        testCase(iw -> {
            iw.addDocuments(docs(2000, "1", 15, 37, 60,  14));
            iw.addDocuments(docs(2000, "2", 74, 150,  50, 90,  40));
        }, verifier, aggTestConfig);
    }
    private List<Document> docs(long startTimestamp, String dim, long... values) throws IOException {
        List<Document> documents = new ArrayList<>();
        for (int i = 0; i < values.length; i++) {
            documents.add(doc(startTimestamp + (i * 1000L), tsid(dim), values[i]));
        }
        return documents;
    }
    private static BytesReference tsid(String dim) throws IOException {
        TimeSeriesIdFieldMapper.TimeSeriesIdBuilder idBuilder = new TimeSeriesIdFieldMapper.TimeSeriesIdBuilder(null);
        idBuilder.addString("dim", dim);
        return idBuilder.build();
    }
    private Document doc(long timestamp, BytesReference tsid, long counterValue) {
        Document doc = new Document();
        doc.add(new SortedNumericDocValuesField("@timestamp", timestamp));
        doc.add(new SortedDocValuesField("_tsid", tsid.toBytesRef()));
        doc.add(new NumericDocValuesField("counter_field", counterValue));
        return doc;
    }
    private MappedFieldType counterField(String name) {