diff --git a/objects/glob.py b/objects/glob.py index 2997c85..8e7cfc6 100644 --- a/objects/glob.py +++ b/objects/glob.py @@ -1,7 +1,6 @@ """Global objects and variables""" import time - from common.ddog import datadogClient from common.files import fileBuffer, fileLocks from objects import channelList @@ -26,7 +25,6 @@ banchoConf = None tokens = tokenList.tokenList() channels = channelList.channelList() matches = matchList.matchList() -restarting = False fLocks = fileLocks.fileLocks() fileBuffers = fileBuffer.buffersList() schiavo = schiavo.schiavo() @@ -45,8 +43,8 @@ gzip = False localize = False sentry = False irc = False +restarting = False startTime = int(time.time()) - streams = streamList.streamList() diff --git a/pep.py b/pep.py index 27b33fd..f194b08 100644 --- a/pep.py +++ b/pep.py @@ -202,6 +202,19 @@ if __name__ == "__main__": [ datadogClient.periodicCheck("online_users", lambda: len(glob.tokens.tokens)), 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: consoleHelper.printColored("[!] Warning! Datadog stats tracking is disabled!", bcolors.YELLOW) diff --git a/requirements.txt b/requirements.txt index 5e18baa..fc3d423 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ mysqlclient psutil raven bcrypt>=3.1.1 +dill \ No newline at end of file