iwla

iwla Commit Details

Date:2014-12-14 14:50:30 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:9da4eb385820683e6a54a9e6e5b8031157d4dd94
Parents: bb7ce4af907b0f2064c1c7a225f230d5f64f3035
Message:Seems ok for account

Changes:
Miwla.py (2 diffs)

File differences

iwla.py
255255
256256
257257
258
259
260
261
262258
263
259
264260
265261
266262
......
520516
521517
522518
523
524
519
525520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
526535
527
528
536
529537
530
531
532
533538
534539
535540
536
537
538
539
540
541
542
543
544
545
546
547541
548542
549543
hit['is_page'] = self.isPage(uri)
status = int(hit['status'])
if status not in conf.viewed_http_codes:
return
if super_hit['robot'] or\
not status in conf.viewed_http_codes:
not int(hit['status']) in conf.viewed_http_codes:
page_key = 'not_viewed_pages'
hit_key = 'not_viewed_hits'
else:
stats = self._createEmptyStats()
for (k, super_hit) in visits.items():
if super_hit['robot']:
stats['not_viewed_bandwidth'] += super_hit['bandwidth']
if super_hit['last_access'].tm_mday != cur_time.tm_mday:
continue
viewed_page = False
for hit in super_hit['requests'][::-1]:
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:
stats['not_viewed_bandwidth'] += int(hit['body_bytes_sent'])
continue
stats['viewed_bandwidth'] += int(hit['body_bytes_sent'])
if hit['is_page']:
stats['viewed_pages'] += 1
viewed_pages = True
else:
stats['viewed_hits'] += 1
if (conf.count_hit_only_visitors or\
super_hit['viewed_pages']) and\
super_hit['last_access'].tm_mday == cur_time.tm_mday:
viewed_pages):
stats['nb_visitors'] += 1
stats['viewed_bandwidth'] += super_hit['bandwidth']
stats['viewed_pages'] += super_hit['viewed_pages']
stats['viewed_hits'] += super_hit['viewed_hits']
print "== Stats for %d/%02d/%d ==" % (cur_time.tm_year, cur_time.tm_mon, cur_time.tm_mday)
if cur_time.tm_mday > 1:
last_day = cur_time.tm_mday - 1
while last_day:
if last_day in self.current_analysis['days_stats'].keys():
break
last_day -= 1
if last_day:
for k in stats.keys():
if k != 'nb_visitors':
print '%s : %d %d' % (k, stats[k], self.current_analysis['days_stats'][last_day][k])
stats[k] -= self.current_analysis['days_stats'][last_day][k]
print stats
self.current_analysis['days_stats'][cur_time.tm_mday] = stats

Archive Download the corresponding diff file

Branches

Tags