manzik / cmdbench Goto Github PK
View Code? Open in Web Editor NEWQuick and easy resource usage monitoring and benchmarking for any command's CPU, memory, disk usage and runtime.
License: MIT License
Quick and easy resource usage monitoring and benchmarking for any command's CPU, memory, disk usage and runtime.
License: MIT License
Happy to help if there's more interest.
Thanks for working on the project. :) Definitely going to use it on linux.
โ ~ pip install cmdbench
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting cmdbench
Using cached https://files.pythonhosted.org/packages/e5/88/743ce3dde282a14270400d9c70d56dd4ad4759e01214d49b826473500b86/cmdbench-0.1.11.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@2/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-ng1Ykz/cmdbench/setup.py'"'"'; __file__='"'"'/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-ng1Ykz/cmdbench/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-ng1Ykz/cmdbench/pip-egg-info
cwd: /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-ng1Ykz/cmdbench/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-ng1Ykz/cmdbench/setup.py", line 7, in <module>
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
โ ~ pip3 install cmdbench
Collecting cmdbench
Using cached cmdbench-0.1.11.tar.gz (19 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/[email protected]/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-0d2i_f7z/cmdbench/setup.py'"'"'; __file__='"'"'/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-0d2i_f7z/cmdbench/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4
cwd: /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-0d2i_f7z/cmdbench/
Complete output (16 lines):
running egg_info
creating /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info
writing /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/dependency_links.txt
writing entry points to /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/entry_points.txt
writing requirements to /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/requires.txt
writing top-level names to /private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/top_level.txt
writing manifest file '/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/SOURCES.txt'
reading manifest file '/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/SOURCES.txt'
writing manifest file '/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-pip-egg-info-ksb2h8e4/cmdbench.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tb/xncysjgj76j95vbv0bn408600000gn/T/pip-install-0d2i_f7z/cmdbench/setup.py", line 66, in <module>
raise Exception('Sorry, cmdbench is supported only on the Linux operating system.\nIf you would like to use cmdbench on macOS, please create an issue at https://github.com/manzik/cmdbench/issues to request the feature.')
Exception: Sorry, cmdbench is supported only on the Linux operating system.
If you would like to use cmdbench on macOS, please create an issue at https://github.com/manzik/cmdbench/issues to request the feature.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
โ ~
pip install cmdbench
succeeds.
On a system with Python 3.12, this happens:
$ cmdbench
Traceback (most recent call last):
File "/opt/homebrew/bin/cmdbench", line 5, in <module>
from cmdbench.cli import benchmark
File "/opt/homebrew/lib/python3.12/site-packages/cmdbench/cli.py", line 8, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
And with Python 3.12, this happens:
$ cmdbench --iterations=1 "ls -l >/tmp/ls-l"
Benchmarking started..
0%| | 0/1 [00:00<?, ?it/s]Process Process-2:
Process Process-3:
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 349, in wrapper
return fun(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 508, in wrapper
raise raise_from(err, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 349, in wrapper
return fun(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 506, in wrapper
return fun(self)
File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 508, in wrapper
raise raise_from(err, None)
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 375, in _get_kinfo_proc
ret = cext.proc_kinfo_oneshot(self.pid)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 506, in wrapper
return fun(self)
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 375, in _get_kinfo_proc
ret = cext.proc_kinfo_oneshot(self.pid)
ProcessLookupError: [Errno 3] assume no such process (originated from sysctl(kinfo_proc), len == 0)
During handling of the above exception, another exception occurred:
ProcessLookupError: [Errno 3] assume no such process (originated from sysctl(kinfo_proc), len == 0)
Traceback (most recent call last):
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 355, in _init
self.create_time()
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 757, in create_time
self._create_time = self._proc.create_time()
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 349, in wrapper
return fun(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 355, in _init
self.create_time()
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 477, in create_time
return self._get_kinfo_proc()[kinfo_proc_map['ctime']]
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 757, in create_time
self._create_time = self._proc.create_time()
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 354, in wrapper
raise NoSuchProcess(self.pid, self._name)
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 349, in wrapper
return fun(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 477, in create_time
return self._get_kinfo_proc()[kinfo_proc_map['ctime']]
File "/usr/local/lib/python3.9/site-packages/psutil/_psosx.py", line 354, in wrapper
raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: process no longer exists (pid=6528)
psutil.NoSuchProcess: process no longer exists (pid=6528)
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/cmdbench/core.py", line 188, in collect_time_series
p = psutil.Process(shared_process_dict["target_process_pid"])
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 319, in __init__
self._init(pid)
File "/usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 368, in _init
raise NoSuchProcess(pid, msg=msg)
File "/usr/local/lib/python3.9/site-packages/cmdbench/core.py", line 126, in collect_fixed_data
p = psutil.Process(shared_process_dict["target_process_pid"])
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 319, in __init__
self._init(pid)
File "/usr/local/lib/python3.9/site-packages/psutil/__init__.py", line 368, in _init
raise NoSuchProcess(pid, msg=msg)
psutil.NoSuchProcess: process PID not found (pid=6528)
psutil.NoSuchProcess: process PID not found (pid=6528)
Last runtime: 0.003 seconds: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 1/1 [00:01<00:00, 1.52s/it]
Benchmarking done.
====> First Iteration <====
Process:
Stdout: ''
Stderr: 'ls: >/tmp/ls-l: No such file or directory\n'
Runtime: 0.003 second(s)
Exit code: 1
CPU (seconds):
User time: 0
System time: 0
Total time: 0
Memory (bytes):
Maximum: 0
Maximum per process: 0
Time series:
Sampling milliseconds: array([], dtype=float64)
CPU (percentages): array([], dtype=float64)
Memory (bytes): array([], dtype=float64)
Done.
$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.