zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkalmar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #501: ZOOKEEPER-3019 add metric for slow fsyncs count
Date Fri, 27 Apr 2018 12:47:18 GMT
Github user nkalmar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/501#discussion_r184676493
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -311,6 +325,9 @@ public synchronized void commit() throws IOException {
     
                     syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS);
                     if (syncElapsedMS > fsyncWarningThresholdMS) {
    +                    if(serverStats != null) {
    +                        serverStats.incrementFsyncThresholdExceedCount();
    +                    }
    --- End diff --
    
    We could, sure. This nullcheck is just an extra fail safe measurement. It should be never
null actually, so if it is, that's definitely some error. (If it would be possible, serverStats
would come from constructor actually).


---

Mime
View raw message