iwla

iwla Commit Details

Date:2022-06-23 21:16:30 (5 months 7 days ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:4d3c2107f0167466888e2fe10074605ce1cdd8b0
Parents: 99639b65a460ebe5ea5d7163f0864ba91c3ff1dd
Message:Don't save all visitors requests into database (save space and computing). Can be changed in deufalt_conf.py with keep_requests value

Changes:
Mdefault_conf.py (2 diffs)
Miwla.py (2 diffs)
Mplugins/pre_analysis/robots.py (3 diffs)

File differences

default_conf.py
1515
1616
1717
18
18
1919
2020
2121
......
6060
6161
6262
63
64
65
POST_HOOK_DIRECTORY = HOOKS_ROOT + '.post_analysis'
DISPLAY_HOOK_DIRECTORY = HOOKS_ROOT + '.display'
# Meta Database filename
META_PATH = os.path.join(DB_ROOT, 'meta.db')
META_FILENAME = 'meta.db'
# Database filename per month
DB_FILENAME = 'iwla.db'
# Default locale (english)
locale = 'en_EN'
# Don't keep requests of all visitors into database
keep_requests = False
iwla.py
115115
116116
117117
118
118119
119120
120121
......
646647
647648
648649
650
651
652
653
654
655
649656
650657
651658
robot
hit_only
is_page
keep_requests
valid_visitors:
month_stats without robot and hit only visitors (if not conf.count_hit_only_visitors)
self._generateDisplay()
return
for (k,v) in visits.items():
# Keep at least one request (for referers...)
if not v.get('keep_requests', conf.keep_requests):
if len(v['requests']) > 1:
v['requests'] = [v['requests'][0]]
path = self.getDBFilename(cur_time)
self.logger.info("==> Serialize to %s" % (path))
plugins/pre_analysis/robots.py
3636
3737
3838
39
40
39
4140
4241
4342
......
4948
5049
5150
51
5252
5353
5454
......
7373
7474
7575
76
7677
7778
7879
None
Conf values needed :
page_to_hit_conf*
hit_to_page_conf*
None
Output files :
None
visits :
remote_addr =>
robot
keep_requests
Statistics deletion :
None
self.logger.debug('%s is a robot (caller %s:%d)' % (k, info.function, info.lineno))
super_hit['robot'] = 1
super_hit['keep_requests'] = False
# Basic rule to detect robots
def hook(self):

Archive Download the corresponding diff file

Branches

Tags