[ 
https://issues.apache.org/jira/browse/BEAM-5209?focusedWorklogId=147222&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-147222
 ]

ASF GitHub Bot logged work on BEAM-5209:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Sep/18 17:47
            Start Date: 24/Sep/18 17:47
    Worklog Time Spent: 10m 
      Work Description: aaltay closed pull request #5779: [BEAM-5209] Precommit 
timings notebook: fix illegal characters in URL, add 1day and 1week stats.
URL: https://github.com/apache/beam/pull/5779
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.test-infra/jupyter/precommit_job_times.ipynb 
b/.test-infra/jupyter/precommit_job_times.ipynb
index cadd611dc92..1bfbeda0f70 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",


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 147222)
    Time Spent: 20m  (was: 10m)

> precommit timings notebook: fix illegal characters in URL
> ---------------------------------------------------------
>
>                 Key: BEAM-5209
>                 URL: https://issues.apache.org/jira/browse/BEAM-5209
>             Project: Beam
>          Issue Type: Improvement
>          Components: testing
>            Reporter: Udi Meiri
>            Assignee: Udi Meiri
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to