java. lang.非法参数异常:名为okhttp3.okHttpClient.connection-pool-total-count的度量已存在

hmae6n7t  于 2023-02-14  发布在  Java
关注(0)|答案(1)|浏览(190)

我最近升级了HttpExecutor到v2版本。现在开始在运行测试用例时面临重复指标的问题。

Caused by: java.lang.IllegalArgumentException: A metric named okhttp3.OkHttpClient.connection-pool-total-count already exists
[ERROR] com.main.testSuccessMetadataStore  Time elapsed: 0.088 s  <<< ERROR!
com.google.inject.ProvisionException: 
Unable to provision, see the following errors:
1) [Guice/ErrorInjectingConstructor]: IllegalArgumentException: A metric named okhttp3.OkHttpClient.connection-pool-total-count already exists
thtygnil

thtygnil1#

通过向httpconfiguration的yml添加额外的配置解决了这个问题。问题是我没有为HttpConfiguration传递配置clientId,因此,对于每个测试用例执行,都会为http客户端创建一个新的指标。

相关问题