.BANCHO. Add bancho components RAM usage as datadog stats

This commit is contained in:
Nyo 2016-11-13 12:25:38 +01:00
parent c7c5528588
commit cd75d1ad8d
3 changed files with 15 additions and 3 deletions

View File

@ -1,7 +1,6 @@
"""Global objects and variables""" """Global objects and variables"""
import time import time
from common.ddog import datadogClient from common.ddog import datadogClient
from common.files import fileBuffer, fileLocks from common.files import fileBuffer, fileLocks
from objects import channelList from objects import channelList
@ -26,7 +25,6 @@ banchoConf = None
tokens = tokenList.tokenList() tokens = tokenList.tokenList()
channels = channelList.channelList() channels = channelList.channelList()
matches = matchList.matchList() matches = matchList.matchList()
restarting = False
fLocks = fileLocks.fileLocks() fLocks = fileLocks.fileLocks()
fileBuffers = fileBuffer.buffersList() fileBuffers = fileBuffer.buffersList()
schiavo = schiavo.schiavo() schiavo = schiavo.schiavo()
@ -45,8 +43,8 @@ gzip = False
localize = False localize = False
sentry = False sentry = False
irc = False irc = False
restarting = False
startTime = int(time.time()) startTime = int(time.time())
streams = streamList.streamList() streams = streamList.streamList()

13
pep.py
View File

@ -202,6 +202,19 @@ if __name__ == "__main__":
[ [
datadogClient.periodicCheck("online_users", lambda: len(glob.tokens.tokens)), datadogClient.periodicCheck("online_users", lambda: len(glob.tokens.tokens)),
datadogClient.periodicCheck("multiplayer_matches", lambda: len(glob.matches.matches)), datadogClient.periodicCheck("multiplayer_matches", lambda: len(glob.matches.matches)),
datadogClient.periodicCheck("ram_clients", lambda: generalUtils.getTotalSize(glob.tokens)),
datadogClient.periodicCheck("ram_matches", lambda: generalUtils.getTotalSize(glob.matches)),
datadogClient.periodicCheck("ram_channels", lambda: generalUtils.getTotalSize(glob.channels)),
datadogClient.periodicCheck("ram_file_buffers", lambda: generalUtils.getTotalSize(glob.fileBuffers)),
datadogClient.periodicCheck("ram_file_locks", lambda: generalUtils.getTotalSize(glob.fLocks)),
datadogClient.periodicCheck("ram_datadog", lambda: generalUtils.getTotalSize(glob.datadogClient)),
datadogClient.periodicCheck("ram_verified_cache", lambda: generalUtils.getTotalSize(glob.verifiedCache)),
datadogClient.periodicCheck("ram_userid_cache", lambda: generalUtils.getTotalSize(glob.userIDCache)),
#datadogClient.periodicCheck("ram_pool", lambda: generalUtils.getTotalSize(glob.pool)),
datadogClient.periodicCheck("ram_irc", lambda: generalUtils.getTotalSize(glob.ircServer)),
datadogClient.periodicCheck("ram_tornado", lambda: generalUtils.getTotalSize(glob.application)),
datadogClient.periodicCheck("ram_db", lambda: generalUtils.getTotalSize(glob.db)),
]) ])
else: else:
consoleHelper.printColored("[!] Warning! Datadog stats tracking is disabled!", bcolors.YELLOW) consoleHelper.printColored("[!] Warning! Datadog stats tracking is disabled!", bcolors.YELLOW)

View File

@ -4,3 +4,4 @@ mysqlclient
psutil psutil
raven raven
bcrypt>=3.1.1 bcrypt>=3.1.1
dill