Update main.py to include session ID in stats and modify player stats key; update telegraf.conf to add session input

This commit is contained in:
2025-01-29 22:51:19 +01:00
parent e4101b5a0a
commit b22ec6f75a
2 changed files with 4 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ def downloadStats(driver: webdriver.Chrome, peersDict: dict):
serverBytes = int(server) * (1024 ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[serverUnit])
peerBytes = int(peer) * (1024 ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[peerUnit])
playerStats[stat] = {'Server': serverBytes, 'Peer': peerBytes}
playerStats[stat] = {'Server': serverBytes, 'Peers': peerBytes}
if 'Buffer State' == stat:
del(playerStats[stat])
@@ -150,7 +150,8 @@ def downloadStats(driver: webdriver.Chrome, peersDict: dict):
'player': playerStats,
'peers': peersDict,
'url': driver.current_url,
'timestamp': int(time.time())
'timestamp': int(time.time()),
'session': driver.session_id
}
saveStats([stats])

View File

@@ -13,6 +13,7 @@
[inputs.socket_listener.xpath.tags]
url = "url"
session = "session"
#id = ??
#state = ??