You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gobblin.apache.org by ib...@apache.org on 2019/04/23 16:18:51 UTC

[incubator-gobblin] branch master updated: [GOBBLIN-749] Add logging to limiter server.

This is an automated email from the ASF dual-hosted git repository.

ibuenros pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git


The following commit(s) were added to refs/heads/master by this push:
     new c8abad4  [GOBBLIN-749] Add logging to limiter server.
c8abad4 is described below

commit c8abad4ce4dddb4b6293c07c38f96c78f2fde427
Author: ibuenros <is...@gmail.com>
AuthorDate: Tue Apr 23 09:18:39 2019 -0700

    [GOBBLIN-749] Add logging to limiter server.
    
    Closes #2614 from ibuenros/limiter-logging
---
 .../org/apache/gobblin/restli/throttling/LimiterServerResource.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java b/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java
index 099505f..e7ead1a 100644
--- a/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java
+++ b/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java
@@ -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);
       }