Commit 90ba5e0e authored by Vincent Pelletier's avatar Vincent Pelletier

Include graph period in graph titles.

Because "hits" needs a "per $period" to be meaningful.
parent d6683265
...@@ -375,8 +375,8 @@ def _asHourString(timestamp): ...@@ -375,8 +375,8 @@ def _asHourString(timestamp):
return '%s/%02i/%s %s' % (year, MONTH_VALUE_DICT[month], day, hour) return '%s/%02i/%s %s' % (year, MONTH_VALUE_DICT[month], day, hour)
period_parser = { period_parser = {
'month': (_asDayString, lambda x: '/'.join(x.split('/', 2)[:2])), 'month': (_asDayString, lambda x: '/'.join(x.split('/', 2)[:2]), 'day'),
'day': (_asHourString, lambda x: x.split(' ')[0]), 'day': (_asHourString, lambda x: x.split(' ')[0], 'hour'),
} }
def main(): def main():
...@@ -442,7 +442,7 @@ def main(): ...@@ -442,7 +442,7 @@ def main():
assert not key, key assert not key, key
matchline = re.compile(line_regex).match matchline = re.compile(line_regex).match
matchrequest = REQUEST_PATTERN.match matchrequest = REQUEST_PATTERN.match
asDate, decimator = period_parser[args.period] asDate, decimator, graph_period = period_parser[args.period]
site_list = args.path site_list = args.path
default_site = args.default default_site = args.default
if default_site is None: if default_site is None:
...@@ -572,7 +572,7 @@ def main(): ...@@ -572,7 +572,7 @@ def main():
# Guesstimation: 6px per digit. If only em were allowed... # Guesstimation: 6px per digit. If only em were allowed...
yLabelWidth = max(int(math.log10(max(x[4] for x in daily_data))) + 1, yLabelWidth = max(int(math.log10(max(x[4] for x in daily_data))) + 1,
3) * 6 3) * 6
graph('Apdex', graph('apdex',
[zip(date_list, (x[1] for x in daily_data))], [zip(date_list, (x[1] for x in daily_data))],
{ {
'xaxis': { 'xaxis': {
...@@ -589,7 +589,7 @@ def main(): ...@@ -589,7 +589,7 @@ def main():
'points': {'show': True}, 'points': {'show': True},
}, },
) )
graph('Hits', graph('Hits (per %s)' % graph_period,
[zip(date_list, (x[4] for x in daily_data))], [zip(date_list, (x[4] for x in daily_data))],
{ {
'xaxis': { 'xaxis': {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment