Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1095200BD8 for ; Wed, 7 Dec 2016 19:21:20 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AFAE9160B0C; Wed, 7 Dec 2016 18:21:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 04A30160AF9 for ; Wed, 7 Dec 2016 19:21:19 +0100 (CET) Received: (qmail 47184 invoked by uid 500); 7 Dec 2016 18:21:19 -0000 Mailing-List: contact reviews-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.apache.org Delivered-To: mailing list reviews@aurora.apache.org Received: (qmail 47157 invoked by uid 99); 7 Dec 2016 18:21:18 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 18:21:18 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 78B1F2D9021; Wed, 7 Dec 2016 18:21:18 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6233140433399679716==" MIME-Version: 1.0 Subject: Re: Review Request 54439: Add support for an mttu metric (median time to updated) From: Mehrdad Nurolahzade To: Santhosh Kumar Shanmugham , Mehrdad Nurolahzade , Zameer Manji Cc: Joshua Cohen , Aurora Date: Wed, 07 Dec 2016 18:21:18 -0000 Message-ID: <20161207182118.15025.72436@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Mehrdad Nurolahzade X-ReviewGroup: Aurora X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/54439/ X-Sender: Mehrdad Nurolahzade References: <20161207175057.15025.19169@reviews.apache.org> In-Reply-To: <20161207175057.15025.19169@reviews.apache.org> Reply-To: Mehrdad Nurolahzade X-ReviewRequest-Repository: aurora archived-at: Wed, 07 Dec 2016 18:21:20 -0000 --===============6233140433399679716== 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/54439/#review158360 ----------------------------------------------------------- src/test/java/org/apache/aurora/scheduler/sla/SlaAlgorithmTest.java (line 261) I find the calculation logic in some of these test cases difficult to follow. Could you maybe add comments explaining in plain math what is the justification behind the hard-coded expected values? - Mehrdad Nurolahzade On Dec. 7, 2016, 9:50 a.m., Joshua Cohen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54439/ > ----------------------------------------------------------- > > (Updated Dec. 7, 2016, 9:50 a.m.) > > > Review request for Aurora, Mehrdad Nurolahzade, Santhosh Kumar Shanmugham, and Zameer Manji. > > > Repository: aurora > > > Description > ------- > > The metric is calculated from the time of the `INSTANCE_UPDATING` event to the subsequent `ASSIGNED` event for the task with the same instance id that matches the desired task config from the update details. > > My original approach to this involved converting `GroupType` and `AlgorithmType` from enums (which cannot be generic) to static classes (which, of course, can). This allowed me to avoid unnecessarily passing update details to the `calculate` method of `SlaAlgorithm` since it's ignored in all but the one, new case. However, that ended up being a lot of churn, and since it turns out we need both the task details and the update details to calculate this metric, I went with the below approach. If anyone feels strongly, I could go back to generics and create an container class that's gives access to both the tasks and update details. > > > Diffs > ----- > > src/main/java/org/apache/aurora/scheduler/sla/MetricCalculator.java 9a56cda809fbbcb07e6dd12c7a0feb272542491d > src/main/java/org/apache/aurora/scheduler/sla/SlaAlgorithm.java 5d8d5bd8f705770979f284d26d2e932aabe707e5 > src/main/java/org/apache/aurora/scheduler/sla/SlaGroup.java 6fbd4e962b3bb6eeb0831c810a321478fd52172c > src/test/java/org/apache/aurora/scheduler/sla/MetricCalculatorTest.java 953b65f28a585375e36e305dea6f9f94f99abc93 > src/test/java/org/apache/aurora/scheduler/sla/SlaAlgorithmTest.java 2e719ac6b7aea86faa22deff2cc6b5f73135761c > src/test/java/org/apache/aurora/scheduler/sla/SlaModuleTest.java 341e346e794c9cf9a2789b8799f38fff900ec9b3 > src/test/java/org/apache/aurora/scheduler/sla/SlaTestUtil.java 78f440f7546de9ed6842cb51db02b3bddc9a74ff > src/test/java/org/apache/aurora/scheduler/storage/testing/StorageTestUtil.java 21d26b3930ea965487b2dec48a48a98677ba022b > src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java 43e32eede27bbf26363a3fd1ca34ffe6f8c01a73 > src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java 6d0e9bc6a8040393875d4f0a88e8db9d6926a88b > > Diff: https://reviews.apache.org/r/54439/diff/ > > > Testing > ------- > > ./gradlew build -Pq > e2e tests. > > > Thanks, > > Joshua Cohen > > --===============6233140433399679716==--