springboot应用 micrometer-core 版本升级
所属分类 springboot
浏览量 1014
private static Map buildTimerInfoMapOne(Timer timer){
Map map = new LinkedHashMap<>();
map.put("count", timer.count());
map.put("mean", timer.mean(TimeUnit.MILLISECONDS));
map.put("max", timer.max(TimeUnit.MILLISECONDS));
map.put("p99", timer.percentile(0.99, TimeUnit.MILLISECONDS));
map.put("p999", timer.percentile(0.999, TimeUnit.MILLISECONDS));
map.put("p9999", timer.percentile(0.9999, TimeUnit.MILLISECONDS));
try {
map.put("snapshot", timer.takeSnapshot().toString());
}catch(Throwable e) {
map.put("takeSnapshotError", e+"");
}
return map;
}
调用报错
java.lang.NoSuchMethodError: io.micrometer.core.instrument.Timer.takeSnapshot()Lio/micrometer/core/instrument/distribution/HistogramSnapshot
arthas 查看类加载信息
sc -d io.micrometer.core.instrument.Timer
micrometer-core-1.0.1.jar
watch xxx.MicrometerUtil buildTimerInfoMapOne "{params[0],returnObj}"
ts=2021-09-01 18:27:08; [cost=0.116296ms] result=@ArrayList[
@CompositeTimer[io.micrometer.core.instrument.composite.CompositeTimer@7bdb5ced],
@LinkedHashMap[isEmpty=false;size=7],
]
CompositeTimer
micrometer-core-1.0.1
micrometer-core-1.7.1
pom.xml
io.micrometer
micrometer-core
1.7.1
提示
Overriding managed version 1.0.1 for micrometer-core
在父pom里强制指定版本 ,升级到 1.7.1
io.micrometer
micrometer-core
1.7.1
cn.tongdun
salaxy-dependencies-bom
${revision}
pom
import
org.springframework.boot
spring-boot-dependencies
2.0.0.RELEASE
pom
import
上一篇
下一篇
移动通信发展简史
农商银行社保卡及银行卡
躺平那些事
新能源汽车动力电池
银行卡分类
linux启动过程