[ARVADOS] created: 22607080cb84506ac396e0867192fe8a7723d9e8
git at public.curoverse.com
git at public.curoverse.com
Tue Feb 9 10:59:08 EST 2016
at 22607080cb84506ac396e0867192fe8a7723d9e8 (commit)
commit 22607080cb84506ac396e0867192fe8a7723d9e8
Author: Tom Clegg <tom at curoverse.com>
Date: Tue Feb 9 10:27:47 2016 -0500
8341: Fix up debug labels
diff --git a/tools/crunchstat-summary/crunchstat_summary/reader.py b/tools/crunchstat-summary/crunchstat_summary/reader.py
index 049b48f..3af86d1 100644
--- a/tools/crunchstat-summary/crunchstat_summary/reader.py
+++ b/tools/crunchstat-summary/crunchstat_summary/reader.py
@@ -17,6 +17,10 @@ class CollectionReader(object):
"collection {} has {} files; need exactly one".format(
collection_id, len(filenames)))
self._reader = collection.open(filenames[0])
+ self._label = "{}/{}".format(collection_id, filenames[0])
+
+ def __str__(self):
+ return self._label
def __iter__(self):
return iter(self._reader)
@@ -27,19 +31,22 @@ class LiveLogReader(object):
def __init__(self, job_uuid):
logger.debug('load stderr events for job %s', job_uuid)
- self._filters = [
- ['object_uuid', '=', job_uuid],
- ['event_type', '=', 'stderr']]
- self._label = job_uuid
+ self.job_uuid = job_uuid
+
+ def __str__(self):
+ return self.job_uuid
def _get_all_pages(self):
got = 0
last_id = 0
+ filters = [
+ ['object_uuid', '=', self.job_uuid],
+ ['event_type', '=', 'stderr']]
while True:
page = arvados.api().logs().index(
limit=1000,
order=['id asc'],
- filters=self._filters + [['id','>',str(last_id)]],
+ filters=filters + [['id','>',str(last_id)]],
).execute(num_retries=2)
got += len(page['items'])
logger.debug(
diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 70b85f8..458e2e0 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -52,7 +52,7 @@ class Summarizer(object):
# constructor will overwrite this with something useful.
self.existing_constraints = {}
- logger.debug("%s: logdata %s", self.label, repr(logdata))
+ logger.debug("%s: logdata %s", self.label, logdata)
def run(self):
logger.debug("%s: parsing log data", self.label)
commit cf07a2d9d58ff4d5344f19655fc3a37e2281821a
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Feb 8 15:47:02 2016 -0500
8341: Do not round up Y axis to even numbers, just use max series value.
Remove Y axis labels (so X axis matches other graphs from the same
job), add grid lines.
diff --git a/tools/crunchstat-summary/crunchstat_summary/chartjs.py b/tools/crunchstat-summary/crunchstat_summary/chartjs.py
index fb30041..f95221e 100644
--- a/tools/crunchstat-summary/crunchstat_summary/chartjs.py
+++ b/tools/crunchstat-summary/crunchstat_summary/chartjs.py
@@ -2,6 +2,7 @@ from __future__ import print_function
import cgi
import json
+import math
import pkg_resources
from crunchstat_summary import logger
@@ -35,12 +36,24 @@ class ChartJS(object):
}
for s in self.summarizers]
+ def _axisY(self, tasks, stat):
+ ymax = max(
+ max(1, *(pt[1] for pt in task.series[stat]))
+ for task in tasks.itervalues())
+ ytick = math.exp((1+math.floor(math.log(ymax, 2)))*math.log(2))/4
+ return {
+ 'gridColor': '#cccccc',
+ 'gridThickness': 1,
+ 'interval': ytick,
+ 'minimum': 0,
+ 'maximum': ymax,
+ 'valueFormatString': "''",
+ }
+
def charts(self, label, tasks):
return [
{
- 'axisY': {
- 'minimum': 0,
- },
+ 'axisY': self._axisY(tasks, stat),
'data': [
{
'type': 'line',
commit 4800c10a866d7576410beca411234001c93b858b
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Feb 8 09:56:10 2016 -0500
8341: Use "time since job start", not "time since task start", as X axis.
diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 48bec6a..70b85f8 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -87,6 +87,7 @@ class Summarizer(object):
child_summarizer.stats_max = self.stats_max
child_summarizer.task_stats = self.task_stats
child_summarizer.tasks = self.tasks
+ child_summarizer.starttime = self.starttime
child_summarizer.run()
logger.debug('%s: done %s', self.label, uuid)
continue
@@ -160,11 +161,11 @@ class Summarizer(object):
val = val / this_interval_s
if stat in ['user+sys__rate', 'tx+rx__rate']:
task.series[category, stat].append(
- (timestamp - task.starttime, val))
+ (timestamp - self.starttime, val))
else:
if stat in ['rss']:
task.series[category, stat].append(
- (timestamp - task.starttime, val))
+ (timestamp - self.starttime, val))
self.task_stats[task_id][category][stat] = val
if val > self.stats_max[category][stat]:
self.stats_max[category][stat] = val
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list