small tweak

This commit is contained in:
Thomas Maddox 2013-09-13 11:25:32 -05:00
parent 1c8afed7aa
commit dfb5916833
2 changed files with 6 additions and 9 deletions

View File

@ -169,10 +169,9 @@ if __name__ == '__main__':
for request in requests:
uuid = request['instance']
request_id = request['request_id']
if uuid in inst_recs:
inst_recs[uuid].append(request_id)
else:
inst_recs[uuid] = [request_id]
value = inst_recs.get(uuid, [])
value.append(request_id)
inst_recs[uuid] = value
for uuid_dict in updates:
uuid = uuid_dict['instance']

View File

@ -61,11 +61,9 @@ def make_report(yesterday=None, start_hour=0, hours=24, percentile=97,
for request in requests:
uuid = request['instance']
request_id = request['request_id']
if uuid in inst_recs:
inst_recs[uuid].append(request_id)
else:
inst_recs[uuid] = [request_id]
value = inst_recs.get(uuid, [])
value.append(request_id)
inst_recs[uuid] = value
failures = {} # { key : {failure_type: count} }
durations = {}