Modifications cosmetiques

This commit is contained in:
David 2022-12-18 22:51:41 +01:00
parent 809c738acd
commit 637a0c9519

View File

@ -17,21 +17,8 @@ statsPath = '/srv/visio.chapril.org/statistiques'
# Fonctions # Fonctions
def runMain(): def runMain():
response = requests.get(api_url,timeout=1) response = requests.get(api_url,timeout=1)
current_ts = response.json()['current_timestamp']
total_participants = response.json()['total_participants']
bit_rate_download = response.json()['bit_rate_download']
total_loss_degraded_participant_seconds = response.json()['total_loss_degraded_participant_seconds']
conferences = response.json()['conferences']
participants = response.json()['participants']
bit_rate_upload = response.json()['bit_rate_upload']
total_visitors = response.json()['total_visitors']
total_conference_seconds = response.json()['total_conference_seconds']
total_conferences_created = response.json()['total_conferences_created']
total_failed_conferences = response.json()['total_failed_conferences']
element = datetime.datetime.strptime(response.json()['current_timestamp'],'%Y-%m-%d %H:%M:%S.%f') element = datetime.datetime.strptime(response.json()['current_timestamp'],'%Y-%m-%d %H:%M:%S.%f')
tpl = element.timetuple() timestamp = int(time.mktime(element.timetuple()))
timestamp = int(time.mktime(tpl))
with open(f'/{statsPath}/jisti_meet_stats_{timestamp}.csv','w') as fh: with open(f'/{statsPath}/jisti_meet_stats_{timestamp}.csv','w') as fh:
for (k,v) in response.json().items(): for (k,v) in response.json().items():
fh.write(f"{k};{v};{timestamp}\n") fh.write(f"{k};{v};{timestamp}\n")