From commits-return-94177-archive-asf-public=cust-asf.ponee.io@beam.apache.org Mon Sep 24 19:47:55 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 E20D2180649 for ; Mon, 24 Sep 2018 19:47:54 +0200 (CEST) Received: (qmail 74407 invoked by uid 500); 24 Sep 2018 17:47:54 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 74397 invoked by uid 99); 24 Sep 2018 17:47:54 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Sep 2018 17:47:54 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 63394829A3; Mon, 24 Sep 2018 17:47:53 +0000 (UTC) Date: Mon, 24 Sep 2018 17:47:53 +0000 To: "commits@beam.apache.org" Subject: [beam] branch master updated: [BEAM-5209] Precommit timings notebook: fix illegal characters in URL, add 1day and 1week stats. (#5779) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153781127281.11436.15615113145507988227@gitbox.apache.org> From: altay@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: beam X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a5bc2cbf07eb46d0af208190a2d828b96421fdab X-Git-Newrev: 02eadb12d583b876f639aee027dc61f8c18191df X-Git-Rev: 02eadb12d583b876f639aee027dc61f8c18191df X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. altay pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/beam.git The following commit(s) were added to refs/heads/master by this push: new 02eadb1 [BEAM-5209] Precommit timings notebook: fix illegal characters in URL, add 1day and 1week stats. (#5779) 02eadb1 is described below commit 02eadb12d583b876f639aee027dc61f8c18191df Author: Udi Meiri AuthorDate: Mon Sep 24 20:47:43 2018 +0300 [BEAM-5209] Precommit timings notebook: fix illegal characters in URL, add 1day and 1week stats. (#5779) * Precommit timings notebook: add 1day, 1week stats. * Fix illegal characters in request URL. Square brackets were not being quoted. --- .test-infra/jupyter/precommit_job_times.ipynb | 44 +++++++++++++++++---------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/.test-infra/jupyter/precommit_job_times.ipynb b/.test-infra/jupyter/precommit_job_times.ipynb index cadd611..1bfbeda 100644 --- a/.test-infra/jupyter/precommit_job_times.ipynb +++ b/.test-infra/jupyter/precommit_job_times.ipynb @@ -84,8 +84,10 @@ "builds = []\n", "job_names = ['beam_PreCommit_Java_Cron', 'beam_PreCommit_Python_Cron', 'beam_PreCommit_Go_Cron']\n", "for job_name in job_names:\n", - " url = 'https://builds.apache.org/job/%s/api/json?tree=%s[result,number,timestamp,actions[queuingDurationMillis,totalDurationMillis]]' % (job_name, builds_key)\n", - " r = requests.get(url)\n", + " url = 'https://builds.apache.org/job/%s/api/json' % job_name\n", + " params = {\n", + " 'tree': '%s[result,number,timestamp,actions[queuingDurationMillis,totalDurationMillis]]' % builds_key}\n", + " r = requests.get(url, params=params)\n", " data = r.json()\n", " builds.extend([Build(job_name, build_json)\n", " for build_json in data[builds_key]])\n", @@ -93,7 +95,11 @@ "df = pd.DataFrame(builds)\n", "\n", "timestamp_cutoff = pd.Timestamp.utcnow().tz_convert(None) - pd.Timedelta(weeks=4)\n", - "df_4weeks = df[df.timestamp >= timestamp_cutoff]" + "df_4weeks = df[df.timestamp >= timestamp_cutoff]\n", + "timestamp_cutoff = pd.Timestamp.utcnow().tz_convert(None) - pd.Timedelta(weeks=1)\n", + "df_1week = df[df.timestamp >= timestamp_cutoff]\n", + "timestamp_cutoff = pd.Timestamp.utcnow().tz_convert(None) - pd.Timedelta(days=1)\n", + "df_1day = df[df.timestamp >= timestamp_cutoff]" ] }, { @@ -117,20 +123,27 @@ "metadata": {}, "outputs": [], "source": [ - "# Get metrics\n", + "# Get 95th percentile of precommit run times.\n", + "test_dfs = {'4 weeks': df_4weeks, '1 week': df_1week, '1 day': df_1day}\n", "metrics = []\n", "\n", - "for job_name in job_names:\n", - " df_times = df_4weeks[df_4weeks.job_name == job_name]\n", - " #df_times = df_times[['totalDurationMinutes', 'result']]\n", - " res_total_all = np.percentile(df_times.totalDurationMinutes, q=95)\n", - " res_total_success = np.percentile(df_times[df_times.result == 'SUCCESS'].totalDurationMinutes, q=95)\n", - " res_queue = np.percentile(df_times.queuingDurationMinutes, q=95)\n", - " metrics.append({'job_name': job_name, 'totalDurationMinutes_95th_all': res_total_all,\n", - " 'totalDurationMinutes_95th_success_only': res_total_success,\n", - " 'queuingDurationMinutes_95th': res_queue})\n", - "\n", - "pd.DataFrame(metrics)" + "for sample_time, test_df in test_dfs.items():\n", + " for job_name in job_names:\n", + " df_times = test_df[test_df.job_name == job_name]\n", + " for percentile in [95]:\n", + " total_all = np.percentile(df_times.totalDurationMinutes, q=percentile)\n", + " total_success = np.percentile(df_times[df_times.result == 'SUCCESS'].totalDurationMinutes,\n", + " q=percentile)\n", + " queue = np.percentile(df_times.queuingDurationMinutes, q=percentile)\n", + " metrics.append({'job_name': '%s %s %dth' % (\n", + " job_name.replace('beam_PreCommit_','').replace('_GradleBuild',''),\n", + " sample_time, percentile),\n", + " 'totalDurationMinutes_all': total_all,\n", + " 'totalDurationMinutes_success_only': total_success,\n", + " 'queuingDurationMinutes': queue,\n", + " })\n", + "\n", + "pd.DataFrame(metrics).sort_values('job_name')" ] }, { @@ -151,7 +164,6 @@ " num_fetched = 0\n", " for build_num in build_nums:\n", " url = 'https://builds.apache.org/job/%s/%s/testReport/api/json?depth=1' % (job_name, build_num)\n", - " #print(url)\n", " print('.', end='')\n", " r = requests.get(url)\n", " if not r.ok:\n",