We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This one is useful to compute memory used by a process (on Linux only):
def mem(): with open('/proc/self/status') as f: m = f.read().split('VmRSS:')[1].split('\n')[0][:-3] return f"{int(m.strip()) // 1024:-3d}M"
This one is good for logging time of some arbitrary code in a with:
@contextlib.contextmanager def time_and_log(self, name): s = time.perf_counter() yield r = time.perf_counter() - s self.log( "{} seconds={:.2}", name, r, pkdebug_frame=inspect.currentframe().f_back )
pykern.perf or some other module name should be created to support these operations. Maybe even a "how much does this operation use in DRS".
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This one is useful to compute memory used by a process (on Linux only):
This one is good for logging time of some arbitrary code in a with:
pykern.perf or some other module name should be created to support these operations. Maybe even a "how much does this operation use in DRS".
The text was updated successfully, but these errors were encountered: