From a518745027b70f2e50588b0f3ab8b74e65d438cb Mon Sep 17 00:00:00 2001 From: David Date: Wed, 4 Jan 2023 14:11:03 +0100 Subject: [PATCH] config test --- statistiques/parseStats.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/statistiques/parseStats.py b/statistiques/parseStats.py index f2d01df..b0146f6 100755 --- a/statistiques/parseStats.py +++ b/statistiques/parseStats.py @@ -8,6 +8,7 @@ import time import datetime from calendar import monthrange import sqlite3 +import numpy as np # Constantes STAT_DIR = '/srv/visio.chapril.org/statistiques/' @@ -84,7 +85,11 @@ class Stats: def parse(self): tot_part_start = tot_part_end = 0 tot_part_start = self.db.dbQuery(f"""SELECT value_field FROM {dbName} WHERE timestamp = {self.startDate} AND key_field = 'total_participants'""")[-1][0] - tot_part_end = self.db.dbQuery(f"""SELECT value_field FROM {dbName} WHERE timestamp < {self.endDate} AND key_field = 'total_participants'""")[-1][0] + tot_part_end = self.db.dbQuery(f"""SELECT value_field FROM {dbName} WHERE timestamp > 'self.startDae= AND timestamp < {self.endDate} AND key_field = 'total_participants'""") + max_tot = [] + for mx in tot_part_end: + max_tot.append(int(mx[0])) + tot_part_end = np.max(max_tot) tot_part = int(tot_part_end) - int(tot_part_start) print(tot_part)