curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] curator pull request #165: [CURATOR-349] Expose extra metrics in TracerDrive...
Date Mon, 10 Oct 2016 22:01:20 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/curator/pull/165#discussion_r82691347
  
    --- Diff: curator-client/src/main/java/org/apache/curator/ConnectionState.java ---
    @@ -199,13 +202,28 @@ private synchronized void checkTimeouts() throws Exception
                         {
                             log.error(String.format("Connection timed out for connection
string (%s) and timeout (%d) / elapsed (%d)", zooKeeper.getConnectionString(), connectionTimeoutMs,
elapsed), connectionLossException);
                         }
    -                    tracer.get().addCount("connections-timed-out", 1);
    +                    new EventTrace("connections-timed-out", tracer.get(), getSessionId()).commit();
                         throw connectionLossException;
                     }
                 }
             }
         }
     
    +    /**
    +     * Return the current session id
    +     */
    +    public long getSessionId() {
    +        long sessionId = -1;
    +        if (isConnected()) {
    +            try {
    +                sessionId = getZooKeeper().getSessionId();
    --- End diff --
    
    Session id is a useful information to track the client side issue, it's kind of identity,
so we would like to include it. I'll change it to use zookeeper.getZookeeper() directly here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message