In [1]:
import time
import numpy as np
import pandas
import batlabcache
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

# some setup
pandas.options.display.max_rows = 15
pandas.set_option('display.mpl_style', 'default')
now_year, now_month = time.gmtime()[:2]

# cyclusci first started using batlab in July 2013
start_year, start_month = 2013, 7
cache = batlabcache.BatlabCache(start_year, start_month, username='cyclusci')
cache.download_last_month()


downloading http://submit-1.batlab.org/nmi/results/overview?user=cyclusci&date=between+2014-10-01+and+2014-11-01&sortDirection=down&storedSearch=0&sortBy=start
...saved as /home/scopatz/cicyphean/cache/cyclusci_2014-10.html in 3e+00 s

In [2]:
df = cache.overview(start_year, start_month, now_year, now_month)
df


Out[2]:
description duration id platforms project result start type user
2013-07-16 16:55:45 Builds Cyclopt… 6951 149360 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-16 16:55:45 TEST cyclusci
2013-07-17 10:00:01 Builds Cyclopt… 10971 149868 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-17 10:00:01 TEST cyclusci
2013-07-17 15:45:24 Builds Cyclopt… 4202 150107 x86_64_Ubuntu12 Cyclus Failed one platform 2013-07-17 15:45:24 TEST cyclusci
2013-07-17 21:30:02 Builds Cyclopt… 2455 150178 x86_64_Ubuntu12 Cyclus Failed one platform 2013-07-17 21:30:02 TEST cyclusci
2013-07-18 01:37:03 Builds Cyclopt… 9739 150348 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-18 01:37:03 TEST cyclusci
2013-07-18 05:00:01 Builds Cyclopt… 10585 150466 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-18 05:00:01 TEST cyclusci
2013-07-18 10:00:01 Builds Cyclopt… 6904 150471 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-18 10:00:01 TEST cyclusci
2013-07-18 13:12:49 Builds Cyclopt… 289 150535 x86_64_MacOSX8 Cyclus Failed one platform 2013-07-18 13:12:49 TEST cyclusci
2013-07-18 13:27:07 Builds Cyclopt… 7701 150542 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-18 13:27:07 TEST cyclusci
2013-07-18 13:27:32 None 605 150543 (0/0/0/0/0) Cycamore Removed 2013-07-18 13:27:32 TEST cyclusci
2013-07-18 13:37:42 None 626 150549 x86_64_MacOSX8 Cycamore Failed one platform 2013-07-18 13:37:42 TEST cyclusci
2013-07-18 13:55:51 Builds Cyclopt… 7524 150568 x86_64_Ubuntu12 Cyclus Succeeded 2013-07-18 13:55:51 TEST cyclusci
2013-07-18 14:01:46 None 702 150576 x86_64_MacOSX8 Cycamore Failed one platform 2013-07-18 14:01:46 TEST cyclusci
2013-07-18 14:22:21 None 1433 150591 x86_64_MacOSX8 Cycamore Failed one platform 2013-07-18 14:22:21 TEST cyclusci
2013-07-18 14:59:40 None 652 150611 x86_64_MacOSX8 Cycamore Failed one platform 2013-07-18 14:59:40 TEST cyclusci
... ... ... ... ... ... ... ... ...

2874 rows × 9 columns

Total wall-clock time of all jobs


In [3]:
# durration is in seconds
dur = df['duration'].sum()
print("{0:.2f} hrs".format(dur/3600.0))


5962.22 hrs

Job counts by success or failure


In [4]:
df.result.value_counts()


Out[4]:
Succeeded              1599
Failed one platform     485
Failed 2 platforms      460
Removed                 326
Failed 3 platforms        4
dtype: int64

In [5]:
ax = (df.duration/3600.0).plot(figsize=(15, 6))
ax.set_ylabel("Duration [hrs]")


Out[5]:
<matplotlib.text.Text at 0x7f719e20b908>

In [6]:
monthly = df.groupby([df.index.year, df.index.month]).transform(np.sum)

In [7]:
ax = (monthly.duration/3600.0).plot(figsize=(15, 6))
ax.set_ylabel("Duration [hrs]")


Out[7]:
<matplotlib.text.Text at 0x7f719e1ab358>

In [ ]: