From dev-return-70325-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jun 4 08:03:53 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F18CE180636 for ; Mon, 4 Jun 2018 08:03:52 +0200 (CEST) Received: (qmail 96027 invoked by uid 500); 4 Jun 2018 06:03:51 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 96016 invoked by uid 99); 4 Jun 2018 06:03:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2018 06:03:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 25A12DFA6D; Mon, 4 Jun 2018 06:03:51 +0000 (UTC) From: lvfangmin To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #510: ZOOKEEPER-3019 add metric for slow fsyncs count Content-Type: text/plain Message-Id: <20180604060351.25A12DFA6D@git1-us-west.apache.org> Date: Mon, 4 Jun 2018 06:03:51 +0000 (UTC) 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. ---