fixes variable collision in stats system

This commit is contained in:
John Dickinson 2010-12-30 15:47:18 +00:00 committed by Tarmac
commit c181f26139
2 changed files with 7 additions and 4 deletions

View File

@ -127,7 +127,8 @@ class AccessLogProcessor(object):
d['code'] = int(d['code'])
return d
def process(self, obj_stream, account, container, object_name):
def process(self, obj_stream, data_object_account, data_object_container,
data_object_name):
'''generate hourly groupings of data from one access log file'''
hourly_aggr_info = {}
total_lines = 0
@ -191,7 +192,8 @@ class AccessLogProcessor(object):
hourly_aggr_info[aggr_key] = d
if bad_lines > (total_lines * self.warn_percent):
name = '/'.join([account, container, object_name])
name = '/'.join([data_object_account, data_object_container,
data_object_name])
self.logger.warning('I found a bunch of bad lines in %s '\
'(%d bad, %d total)' % (name, bad_lines, total_lines))
return hourly_aggr_info

View File

@ -22,10 +22,11 @@ class StatsLogProcessor(object):
def __init__(self, conf):
self.logger = get_logger(conf)
def process(self, obj_stream, account, container, object_name):
def process(self, obj_stream, data_object_account, data_object_container,
data_object_name):
'''generate hourly groupings of data from one stats log file'''
account_totals = {}
year, month, day, hour, _ = object_name.split('/')
year, month, day, hour, _ = data_object_name.split('/')
for line in obj_stream:
if not line:
continue