Return-Path: X-Original-To: apmail-samza-dev-archive@minotaur.apache.org Delivered-To: apmail-samza-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92A5F18F28 for ; Tue, 4 Aug 2015 22:36:17 +0000 (UTC) Received: (qmail 892 invoked by uid 500); 4 Aug 2015 22:36:12 -0000 Delivered-To: apmail-samza-dev-archive@samza.apache.org Received: (qmail 833 invoked by uid 500); 4 Aug 2015 22:36:12 -0000 Mailing-List: contact dev-help@samza.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@samza.apache.org Delivered-To: mailing list dev@samza.apache.org Received: (qmail 818 invoked by uid 99); 4 Aug 2015 22:36:12 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2015 22:36:12 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 80F38D8EF1; Tue, 4 Aug 2015 22:36:10 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1840225662274039954==" MIME-Version: 1.0 Subject: Re: Review Request 37069: SAMZA-738 Samza Timer based metrics does not have enough precision From: "Yi Pan (Data Infrastructure)" To: "Aleksandar Pejakovic" , "samza" , "Yi Pan (Data Infrastructure)" Date: Tue, 04 Aug 2015 22:36:10 -0000 Message-ID: <20150804223610.17264.21964@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Yi Pan (Data Infrastructure)" X-ReviewGroup: Samza X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/37069/ X-Sender: "Yi Pan (Data Infrastructure)" References: <20150804091849.4206.40365@reviews.apache.org> In-Reply-To: <20150804091849.4206.40365@reviews.apache.org> Reply-To: "Yi Pan (Data Infrastructure)" X-ReviewRequest-Repository: samza --===============1840225662274039954== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/37069/#review94122 ----------------------------------------------------------- samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 46) Why are we adding a new clock here? changing clock() implementation to: val clock: () => Long = {System.nanoTime} Should work as well. samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 49) The variable should be lastWindowNs and lastCommitNs samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 78) This should be totalNs samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 107) This variable name should also be activeNs samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 134) Same here. samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala (line 135) This does not need to be done by metricClocks. The original code works. Just that there is optimization we should do here to reduce the number of clock() calls. updateTimerAndGetDuration internally calls clock(), and we are calling clock() twice here as well. Should at least cache the return value from clock() and re-use it here. - Yi Pan (Data Infrastructure) On Aug. 4, 2015, 9:18 a.m., Aleksandar Pejakovic wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/37069/ > ----------------------------------------------------------- > > (Updated Aug. 4, 2015, 9:18 a.m.) > > > Review request for samza. > > > Repository: samza > > > Description > ------- > > Changed SystemProducersMetrics and RunLoop so that metrics now show nanoseconds instead milliseconds. > > > Diffs > ----- > > samza-core/src/main/scala/org/apache/samza/container/RunLoop.scala c292ae4 > samza-core/src/main/scala/org/apache/samza/container/SamzaContainerMetrics.scala aa7a9bc > > Diff: https://reviews.apache.org/r/37069/diff/ > > > Testing > ------- > > Tested on hello-samza -> wikipedia-parser, results: > ``` > "org.apache.samza.container.SamzaContainerMetrics":{ > "commit-calls":10, > "window-ns":3198.62544796632, > "process-null-envelopes":56292, > "process-envelopes":989, > "window-calls":0, > "commit-ns":5130.901534393375, > "send-calls":0, > "process-calls":57283, > "choose-ns":10368839.818551894, > "process-ns":10390588.194071393, > "event-loop-utilization":0.99807554 > } > ``` > > > Thanks, > > Aleksandar Pejakovic > > --===============1840225662274039954==--