Optimize analysis using reverse loop

This commit is contained in:
Gregory Soutade
2014-12-14 15:10:13 +01:00
parent 9da4eb3858
commit 3a246d5cd6
6 changed files with 26 additions and 28 deletions
+2 -2
View File
@@ -256,7 +256,7 @@ class IWLA(object):
hit['is_page'] = self.isPage(uri)
if super_hit['robot'] or\
not int(hit['status']) in conf.viewed_http_codes:
not self.hasBeenViewed(hit):
page_key = 'not_viewed_pages'
hit_key = 'not_viewed_hits'
else:
@@ -523,7 +523,7 @@ class IWLA(object):
if hit['time_decoded'].tm_mday != cur_time.tm_mday:
break
if super_hit['robot'] or\
not int(hit['status']) in conf.viewed_http_codes:
not self.hasBeenViewed(hit):
stats['not_viewed_bandwidth'] += int(hit['body_bytes_sent'])
continue
stats['viewed_bandwidth'] += int(hit['body_bytes_sent'])