Skip to main content

Create plots of memory usage for a process.

Project description

process-plot

Build Status codecov.io PyPI version

Create plots of resource usage for a process (memory, CPU, etc).

Process statistics are polled at a set interval, in a cross-platform manner (i.e. supports Linux, OSX and Windows).

Usage

Install the package with pip or pipx:

$ pipx install process-plot

then run:

$ pplot exec -i 0.1 "sleep 1"
PPLOT INFO: Output files will be written to: /user/pplot_out, with basename: 20210921125420
PPLOT INFO: Running process as PID: 5379
PPLOT INFO: Total run time: 0 hour(s), 00 minute(s), 01.034680 second(s)
PPLOT INFO: Plotting results to: pplot_out/20210921125420.png
PPLOT SUCCESS!

You will then find the output files in /user/pplot_out, with a plot for the process like:

example plot

Additional options are available:

$ pplot exec --help
Usage: pplot exec [OPTIONS] COMMAND

  Execute a command and profile it.

Options:
  -i, --interval FLOAT            Polling interval (seconds)
  -t, --timeout FLOAT             Timeout process (seconds)
  -c, --command-output [hide|screen|file]
                                  Mode for stdout/stderr of command  [default:
                                  file]
  -o, --outfolder DIRECTORY       Folder path for output files
  -n, --basename TEXT             Basename for output files (defaults to
                                  datetime)
  -p, --plot-cols [memory_rss|memory_vms|cpu_percent|cpu_time_user|cpu_time_sys|threads_num|files_num]
                                  Columns to plot (comma-delimited)  [default:
                                  memory_rss,cpu_percent]
  --title TEXT                    Plot title (defaults to command)
  --grid / --no-grid              Add grid to plots  [default: grid]
  -sw, --size-width FLOAT         Width of plot in cm
  -sh, --size-height FLOAT        Height of plot in cm
  -f, --format [png|pdf|svg]      Plot file format
  -v, --verbose                   Increase verbosity  [x>=0]
  -q, --quiet                     Quiet mode
  --help                          Show this message and exit.

Acknowledgements

Initially adapted from: https://github.com/jeetsukumaran/Syrupy

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

process_plot-0.3.0.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

process_plot-0.3.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file process_plot-0.3.0.tar.gz.

File metadata

  • Download URL: process_plot-0.3.0.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for process_plot-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d6833107bb7bb4ce6ad0b5850c0897877298ca5e40dcbb469d8c6f6ed6b83edf
MD5 a1112533c43e4a6a67f4f389c09a221b
BLAKE2b-256 524f9549ad61bd9a9ea66cd768c49ac824e71889f013f9b640301db24e8d2895

See more details on using hashes here.

File details

Details for the file process_plot-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: process_plot-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for process_plot-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edb5c1fb39224780ae10edb1e3f8e88f7b12d7ef5f2bbe3fc17c07824c53aa95
MD5 1d723d71f633646b9639d707c74c30a5
BLAKE2b-256 be63e8741ef95766ba4013ffbda6f73d1822cc2df8e545c3daee5ff2f1fdb5fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page