Don't account hits <= last_access (< before)

This commit is contained in:
Gregory Soutade 2014-12-14 15:41:47 +01:00
parent 3c5f117870
commit c221c813bf

View File

@ -551,9 +551,8 @@ class IWLA(object):
self.current_analysis = self._deserialize(self.getDBFilename(t)) or self._clearVisits() self.current_analysis = self._deserialize(self.getDBFilename(t)) or self._clearVisits()
self.analyse_started = True self.analyse_started = True
else: else:
if time.mktime(t) < time.mktime(cur_time): if time.mktime(t) <= time.mktime(cur_time):
return False return False
if not self.analyse_started:
self.analyse_started = True self.analyse_started = True
if cur_time.tm_mon != t.tm_mon: if cur_time.tm_mon != t.tm_mon:
self._generateMonthStats() self._generateMonthStats()
@ -581,6 +580,8 @@ class IWLA(object):
self.meta_infos = self._deserialize(conf.META_PATH) or self._clearMeta() self.meta_infos = self._deserialize(conf.META_PATH) or self._clearMeta()
if self.meta_infos['last_time']: if self.meta_infos['last_time']:
print 'Last time'
print self.meta_infos['last_time']
self.current_analysis = self._deserialize(self.getDBFilename(self.meta_infos['last_time'])) or self._clearVisits() self.current_analysis = self._deserialize(self.getDBFilename(self.meta_infos['last_time'])) or self._clearVisits()
else: else:
self._clearVisits() self._clearVisits()
@ -609,8 +610,7 @@ class IWLA(object):
del self.meta_infos['start_analysis_time'] del self.meta_infos['start_analysis_time']
self._serialize(self.meta_infos, conf.META_PATH) self._serialize(self.meta_infos, conf.META_PATH)
else: else:
print '==> Analyse not started : nothing to do' print '==> Analyse not started : nothing new'
self._generateMonthStats()
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Intelligent Web Log Analyzer') parser = argparse.ArgumentParser(description='Intelligent Web Log Analyzer')