<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.2.0
* Operating System version: linux
* Java version: jdk 1.8

### Steps to reproduce this issue

1. turn on metrics 
  metrics:
    protocol: prometheus
    export-service-port: x0003
    enable-jvm: true
    enable-threadpool: true
    enable-registry: true
    enable-metadata: true
2. pressure test 100 thread

If there is an exception, please attach the exception trace:

Caused by: java.lang.ArrayIndexOutOfBoundsException: null
com.tdunning.math.stats.MergingDigest.merge(MergingDigest.java:381)
com.tdunning.math.stats.MergingDigest.mergeNewValues(MergingDigest.java:363)
com.tdunning.math.stats.MergingDigest.mergeNewValues(MergingDigest.java:353)
com.tdunning.math.stats.MergingDigest.add(MergingDigest.java:259)
com.tdunning.math.stats.MergingDigest.add(MergingDigest.java:251)
com.tdunning.math.stats.AbstractTDigest.add(AbstractTDigest.java:129)
org.apache.dubbo.metrics.aggregate.TimeWindowQuantile.add(TimeWindowQuantile.java:51)
org.apache.dubbo.metrics.collector.AggregateMetricsCollector.onRTEvent(AggregateMetricsCollector.java:92)
org.apache.dubbo.metrics.collector.AggregateMetricsCollector.onEvent(AggregateMetricsCollector.java:82)
org.apache.dubbo.metrics.event.SimpleMetricsEventMulticaster.publishEvent(SimpleMetricsEventMulticaster.java:48)
org.apache.dubbo.metrics.collector.sample.MethodMetricsSampler.lambda$rtConfigure$3(MethodMetricsSampler.java:61)
org.apache.dubbo.metrics.collector.sample.SimpleMetricsCountSampler.addRT(SimpleMetricsCountSampler.java:120)
org.apache.dubbo.metrics.filter.MethodMetricsInterceptor.rtTime(MethodMetricsInterceptor.java:97)
org.apache.dubbo.metrics.filter.MethodMetricsInterceptor.onCompleted(MethodMetricsInterceptor.java:101)
org.apache.dubbo.metrics.filter.MethodMetricsInterceptor.afterMethod(MethodMetricsInterceptor.java:58)
org.apache.dubbo.metrics.filter.MetricsFilter.onResponse(MetricsFilter.java:64)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.lambda$invoke$1(FilterChainBuilder.java:218)
org.apache.dubbo.rpc.AsyncRpcResult.lambda$whenCompleteWithContext$0(AsyncRpcResult.java:228)
java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774)
java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:792)
java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2153)
org.apache.dubbo.rpc.AsyncRpcResult.whenCompleteWithContext(AsyncRpcResult.java:224)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:195)
org.apache.dubbo.rpc.protocol.ReferenceCountInvokerWrapper.invoke(ReferenceCountInvokerWrapper.java:78)
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invokeWithContext(AbstractClusterInvoker.java:380)
org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:81)
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:341)
org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter.invoke(RouterSnapshotFilter.java:46)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.monitor.support.MonitorFilter.invoke$original$vkd7zZMh(MonitorFilter.java:101)
org.apache.dubbo.monitor.support.MonitorFilter.invoke$original$vkd7zZMh$accessor$y8nuUX1o(MonitorFilter.java)
org.apache.dubbo.monitor.support.MonitorFilter$auxiliary$YZgq7bd2.call(Unknown Source)
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86)
org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.cluster.filter.support.MetricsClusterFilter.invoke(MetricsClusterFilter.java:51)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:52)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.cluster.specifyaddress.AddressSpecifyClusterFilter.invoke(AddressSpecifyClusterFilter.java:40)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.spring.security.filter.ContextHolderParametersSelectedTransferFilter.invoke(ContextHolderParametersSelectedTransferFilter.java:41)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.cluster.filter.support.ConsumerClassLoaderFilter.invoke(ConsumerClassLoaderFilter.java:40)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
com.mea.pay.common.dubbo.DubboConsumerContextFilter.invoke(DubboConsumerContextFilter.java:90)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:118)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:331)
org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:194)
org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:91)
org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:103)
com.mea.pay.common.dubbo.TagInvoker.invoke(TagInvoker.java:45)
org.apache.dubbo.rpc.cluster.support.wrapper.ScopeClusterInvoker.invoke(ScopeClusterInvoker.java:131)
org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:284)
\t... 91 common frames omitted

private final double compression;
        public DigestSlidingWindow(double compression, int sampleCount, long intervalInMs) {
            super(sampleCount, intervalInMs);
            this.compression = compression;
        }
        @Override
        public TDigest newEmptyValue(long timeMillis) {
            return TDigest.createDigest(compression);
        }
        @Override
        protected Pane<TDigest> resetPaneTo(final Pane<TDigest> pane, long startTime) {
            pane.setStartInMs(startTime);
            pane.setValue(TDigest.createDigest(compression));
            return pane;
        }
    }
}