fixed request_id and added to pretty.py as well
This commit is contained in:
parent
ef32090835
commit
1c8afed7aa
@ -178,9 +178,7 @@ if __name__ == '__main__':
|
||||
uuid = uuid_dict['instance']
|
||||
|
||||
req_list = []
|
||||
for req_dict in inst_recs.get(uuid, []):
|
||||
req = req_dict['request_id']
|
||||
|
||||
for req in inst_recs.get(uuid, []):
|
||||
raws = list(models.RawData.objects.filter(request_id=req)
|
||||
.exclude(event='compute.instance.exists')
|
||||
.values("id", "when", "routing_key", "old_state",
|
||||
|
@ -52,6 +52,21 @@ def make_report(yesterday=None, start_hour=0, hours=24, percentile=97,
|
||||
expiry = 60 * 60 # 1 hour
|
||||
cmds = ['create', 'rebuild', 'rescue', 'resize', 'snapshot']
|
||||
|
||||
requests = models.RawData.objects.filter(when__gt=dstart, when__lte=dend)\
|
||||
.exclude(instance=None,
|
||||
event='compute.instance.exists')\
|
||||
.values('request_id', 'instance')\
|
||||
.distinct()
|
||||
inst_recs = {}
|
||||
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]
|
||||
|
||||
|
||||
failures = {} # { key : {failure_type: count} }
|
||||
durations = {}
|
||||
attempts = {}
|
||||
@ -59,14 +74,7 @@ def make_report(yesterday=None, start_hour=0, hours=24, percentile=97,
|
||||
for uuid_dict in updates:
|
||||
uuid = uuid_dict['instance']
|
||||
|
||||
# All the unique Request ID's for this instance during that timespan.
|
||||
reqs = models.RawData.objects.filter(instance=uuid,
|
||||
when__gt=dstart, when__lte=dend) \
|
||||
.values('request_id').distinct()
|
||||
|
||||
|
||||
for req_dict in reqs:
|
||||
req = req_dict['request_id']
|
||||
for req in inst_recs.get(uuid, []):
|
||||
raws = models.RawData.objects.filter(request_id=req)\
|
||||
.exclude(event='compute.instance.exists')\
|
||||
.order_by('when')
|
||||
|
Loading…
x
Reference in New Issue
Block a user