Add logging to limiter server.
Closes from ibuenros/limiter-logging
@@ -102,6 +102,7 @@ public class LimiterServerResource extends ComplexKeyResourceAsyncTemplate<Permi
ComplexResourceKey<PermitRequest, EmptyRecord> key,
@CallbackParam final Callback<PermitAllocation> callback) {
try (Closeable context = this.requestTimer == null ? NoopCloseable.INSTANCE : this.requestTimer.time()) {
+ long startNanos = System.nanoTime();
PermitRequest request = key.getKey();
String resourceId = request.getResource();
@@ -146,6 +147,8 @@ public class LimiterServerResource extends ComplexKeyResourceAsyncTemplate<Permi
permitsGrantedMeter.mark(allocation.getPermits());
+ log.debug("Request: {}, allocation: {}, elapsedTime: {} ns", request, allocation, System.nanoTime() - startNanos);
+
callback.onSuccess(allocation);
}
