zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #510: ZOOKEEPER-3019 add metric for slow fsyncs count
Date Mon, 04 Jun 2018 06:03:51 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/510#discussion_r192631195
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
    @@ -320,6 +332,11 @@ public synchronized void commit() throws IOException {
                     long syncElapsedMS =
                         TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS);
                     if (syncElapsedMS > fsyncWarningThresholdMS) {
    +                    if(serverStats != null) {
    +                        serverStats.incrementFsyncThresholdExceedCount();
    +                    } else {
    +                        LOG.warn("fsyncWarningThresholdMS exceeded, but serverStats not
added in FileTxnLog!");
    --- End diff --
    
    This log seems redundant to me, we can tell the fsync threshold exceeded from the log
at line 340, and serverStats is set, we know there will be stats in serverStats, otherwise
we know it's not set.


---

Mime
View raw message