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
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.elasticsearch.search.aggregations.bucket.histogram.InternalDateHistogram;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;
public class TimeSeriesRateAggregatorTests extends AggregatorTestCase {
    @Override
    protected List<SearchPlugin> getSearchPlugins() {
        return List.of(new AggregationsPlugin(), new AnalyticsPlugin());
    }
    public void testSimple() throws IOException {
        RateAggregationBuilder builder = new RateAggregationBuilder("counter_field").field("counter_field");
        TimeSeriesAggregationBuilder tsBuilder = new TimeSeriesAggregationBuilder("tsid");
        tsBuilder.subAggregation(builder);
        Consumer<InternalTimeSeries> verifier = r -> {
            assertThat(r.getBuckets(), hasSize(2));
            assertThat(((Rate) r.getBucketByKey("{dim=1}").getAggregations().asList().get(0)).getValue(), closeTo(59.0 / 3000.0, 0.00001));
            assertThat(((Rate) r.getBucketByKey("{dim=2}").getAggregations().asList().get(0)).getValue(), closeTo(206.0 / 4000.0, 0.00001));
        };
        AggTestConfig aggTestConfig = new AggTestConfig(tsBuilder, timeStampField(), counterField("counter_field"))
            .withSplitLeavesIntoSeperateAggregators(false);
        testCase(iw -> {
            iw.addDocuments(docs(1000, "1", 15, 37, 60,  14));