def show_mem(self): process = psutil.Process(os.getpid()) total = process.memory_info().rss totalmb = total / (1024 * 1024) out = "Total: %s MB\n" % totalmb out += "Total buffers: %s\n" % StreamManager.TotalBuffers() print_tokens([(Token.Number, out)], self.token_style)
def show_mem(self): process = psutil.Process(os.getpid()) total = process.memory_info().rss totalmb = total / (1024 * 1024) out = "Total: %s MB\n" % totalmb out += "Total buffers: %s\n" % StreamManager.TotalBuffers() print_formatted_text(FormattedText([("class:number", out)]), style=self.token_style)
def execute(self, arguments=None): process = psutil.Process(os.getpid()) total = process.memory_info().rss totalmb = total / (1024 * 1024) out = "Total: %s MB\n" % totalmb out += "Total buffers: %s\n" % StreamManager.TotalBuffers() print(out) return out
def show_mem(self): total = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss totalmb = total / 1000000 out = "Total: %s MB\n" % totalmb out += "total buffers %s\n" % StreamManager.TotalBuffers() print_tokens([(Token.Number, out)], self.token_style)