config test

This commit is contained in:
David 2023-01-04 14:11:03 +01:00
parent b053dd7920
commit a518745027

View File

@ -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)