Wrapper for getting process information.
Project description
pagurus
Used for getting the information from a running job based on its pid using psutil.
Install
Availible on PyPi and easily installed in your enviroment.
pip install pagurus
Options
usage: pagurus [-h] [-o OUTFILE] [-p PATH] [-d] [-r RATE] [-u USER] [-noh] [-mv] [-l ROLLING] [--json] [--envvar ENVVAR]
options:
-h, --help show this help message and exit
-o OUTFILE, --outfile OUTFILE
File name for csv.
-p PATH, --path PATH Path to put csv file.
-d, --debug Run with debugging info.
-r RATE, --rate RATE Polling rate for process.
-u USER, --user USER Username to get stats for.
-noh, --no-header Turn off writting the header.
-mv, --move Moves file from 'running' to 'done' directories
-l ROLLING, --rolling ROLLING
Time to roll file over to number to file name in ~minutes.
--json Output JSON strings instead of CSV lines
--envvar ENVVAR add environment var to output (can be specified multiple times)
Running pagurus as a wrapper for a single user
# Start running wrapper in the background for username
pagurus -u $USER -mv -p /path/to/output/dir -o test.csv
# Get the previous running PID of pagurus
export PID=$!
# Sleep for a few seconds to let everything start running
sleep 10
###########################
# Run your desired program as normal
./a.out
# Works with containers
shifter --image=tylern4/memoryhog:latest alloc 2
# and with wrapper scripts
shifter --image=jfroula/aligner-bbmap:2.0.2 bbmap.sh Xmx12g in=sample.fastq.bz2 ref=sample.fasta out=test.sam
###########################
# Kill the pagurus process
kill $PID
# Sleep for a few seconds to let results finish writing
sleep 10
Plotting results example
There is an example notebook which will shows how to get memory usage and cpu usage from the output files.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pagurus-1.2.tar.gz
(7.7 kB
view details)
Built Distribution
pagurus-1.2-py3-none-any.whl
(8.3 kB
view details)
File details
Details for the file pagurus-1.2.tar.gz
.
File metadata
- Download URL: pagurus-1.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95758f4e0bfde1afcebeba8a2dd28103b0b325fae528402215bc27606b031595 |
|
MD5 | c8b25a04cff02f61b714f387f3febdb6 |
|
BLAKE2b-256 | c5036a8ada353201dd0b138cc930190e59ece44273f13c462dcf8f1e935ecc3b |
File details
Details for the file pagurus-1.2-py3-none-any.whl
.
File metadata
- Download URL: pagurus-1.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7f0126a660c3ff4f99334bb0052a23cce60d9591240ce23a2d2ce91bfe07ea |
|
MD5 | 7c1a1c0f3af97c917d2de63c7409f3a9 |
|
BLAKE2b-256 | fdde06c406731866f319ae7407451df5609dc8c221f965489b8f30e9e2296872 |