do not report empty playernames as online
This commit is contained in:
parent
74d57fc124
commit
5432fed77b
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ class MinecraftCollector(object):
|
||||||
playerregex = re.compile("players online:(.*)")
|
playerregex = re.compile("players online:(.*)")
|
||||||
if playerregex.findall(resp):
|
if playerregex.findall(resp):
|
||||||
for player in playerregex.findall(resp)[0].split(","):
|
for player in playerregex.findall(resp)[0].split(","):
|
||||||
if player and player != "":
|
if not player.isspace():
|
||||||
player_online.add_sample('player_online',value=1,labels={'player':player.lstrip()})
|
player_online.add_sample('player_online',value=1,labels={'player':player.lstrip()})
|
||||||
|
|
||||||
return metrics
|
return metrics
|
||||||
|
|
Loading…
Reference in a new issue