config test
This commit is contained in:
parent
b053dd7920
commit
a518745027
@ -8,6 +8,7 @@ import time
|
|||||||
import datetime
|
import datetime
|
||||||
from calendar import monthrange
|
from calendar import monthrange
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
# Constantes
|
# Constantes
|
||||||
STAT_DIR = '/srv/visio.chapril.org/statistiques/'
|
STAT_DIR = '/srv/visio.chapril.org/statistiques/'
|
||||||
@ -84,7 +85,11 @@ class Stats:
|
|||||||
def parse(self):
|
def parse(self):
|
||||||
tot_part_start = tot_part_end = 0
|
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_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)
|
tot_part = int(tot_part_end) - int(tot_part_start)
|
||||||
print(tot_part)
|
print(tot_part)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user