mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
Update MetricsAggregatorService.java (#2272)
This commit is contained in:
parent
e059caa14e
commit
6c623d8d84
@ -32,11 +32,19 @@ public class MetricsAggregatorService {
|
|||||||
.counters()
|
.counters()
|
||||||
.forEach(
|
.forEach(
|
||||||
counter -> {
|
counter -> {
|
||||||
String key =
|
String method = counter.getId().getTag("method");
|
||||||
String.format(
|
String uri = counter.getId().getTag("uri");
|
||||||
"http_requests_%s_%s",
|
|
||||||
counter.getId().getTag("method"),
|
// Skip if either method or uri is null
|
||||||
counter.getId().getTag("uri").replace("/", "_"));
|
if (method == null || uri == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = String.format(
|
||||||
|
"http_requests_%s_%s",
|
||||||
|
method,
|
||||||
|
uri.replace("/", "_")
|
||||||
|
);
|
||||||
|
|
||||||
double currentCount = counter.count();
|
double currentCount = counter.count();
|
||||||
double lastCount = lastSentMetrics.getOrDefault(key, 0.0);
|
double lastCount = lastSentMetrics.getOrDefault(key, 0.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user