Update minecraft_exporter.py

This commit is contained in:
Nathan Easton 2021-12-05 15:35:40 -05:00 committed by GitHub
parent 45dabc2723
commit 6474a5c290
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,6 @@ class MinecraftCollector(object):
resp = str(self.rcon_command("tps")).strip().replace("§a","") resp = str(self.rcon_command("tps")).strip().replace("§a","")
tpsregex = re.compile("TPS from last 1m, 5m, 15m: (\d*\.\d*), (\d*\.\d*), (\d*\.\d*)") tpsregex = re.compile("TPS from last 1m, 5m, 15m: (\d*\.\d*), (\d*\.\d*), (\d*\.\d*)")
for m1,m5,m15 in tpsregex.findall(resp): for m1,m5,m15 in tpsregex.findall(resp):
self.rcon_command("say "+str(m1))
tps_1m.add_sample('paper_tps_1m',value=m1,labels={'tps':'1m'}) tps_1m.add_sample('paper_tps_1m',value=m1,labels={'tps':'1m'})
tps_5m.add_sample('paper_tps_5m',value=m5,labels={'tps':'5m'}) tps_5m.add_sample('paper_tps_5m',value=m5,labels={'tps':'5m'})
tps_15m.add_sample('paper_tps_15m',value=m15,labels={'tps':'15m'}) tps_15m.add_sample('paper_tps_15m',value=m15,labels={'tps':'15m'})