Неправильные метрики для гистограммы с использованием Spring Webflux с микрометром .tap (Micrometer.metrics (MeterRegistJAVA

Программисты JAVA общаются здесь
Anonymous
Неправильные метрики для гистограммы с использованием Spring Webflux с микрометром .tap (Micrometer.metrics (MeterRegist

Сообщение Anonymous »

Чего я хотел бы достичь: < /p>
Использование Spring Webflux и Micrometer, я хотел бы получить гистограмму времени, взятой для выполнения метода. Ну.@RestController
class QuestionController {

MeterRegistry meterRegistry;
Timer responseTime;

public QuestionController(MeterRegistry meterRegistry) {
this.meterRegistry = meterRegistry;
this.responseTime = Timer
.builder("solutionone")
.publishPercentiles(new double[] { 0.5, 0.75, 0.95, 0.99 })
.serviceLevelObjectives(Duration.ofMillis(1000), Duration.ofMillis(2000), Duration.ofMillis(3000), Duration.ofMillis(4000))
.maximumExpectedValue(Duration.ofMillis(6000))
.register(this.meterRegistry);
}

@GetMapping("/question")
Mono question(@RequestParam(value = "id", required = true) int id) {
return Mono.just(id)
.map(oneId -> {
Timer.Sample sample = Timer.start(meterRegistry);
String result = func(oneId); //func will be shown later, but imagine anything you want to measure
sample.stop(responseTime);
return result;
})
;
}

Изображение

It seems that:

I lost my "buckets" I would like to see the

Подробнее здесь: https://stackoverflow.com/questions/795 ... -tapmicrom

Вернуться в «JAVA»