Optimize analysis using reverse loop
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user