Skip to main content

A simple IPython extension for monitoring memory usage of Jupyter notebook cells.

Project description

memprofiler

PyPI Binder

memprofiler is a simple extension for monitoring memory usage of Jupyter notebook cells.

Installation

It can be installed as a typical Python source package from PyPi using pip:

pip install memprofiler

Usage

A basic example of how to use this extension can be found in this interactive Jupyter notebook.

Reference

mprof_run

%%mprof_run [-q] [-i INTERVAL] [-p] profile_id

Run memory profiler during cell execution. (cell_magic)

  • positional arguments:

    • profile_id
      Profile identifier to label the results.
  • optional arguments:

    • -q, --quiet
      Suppress verbosity.

    • -i INTERVAL, --interval INTERVAL
      Sampling period (in seconds), default 0.01.

    • -p, --plot
      Plot the memory profile.

mprof_plot

%mprof_plot [-t TITLE] [--variable {time,memory}] profile_ids [profile_ids ...]

Plot detailed memory profiler results. (line_magic)

  • positional arguments:

    • profile_ids
      Profile identifiers made by mprof_run. Supports regex.
  • optional arguments:

    • -t TITLE, --title TITLE
      String shown as plot title.

    • --groupby <{0,1}>
      Identifier number used to group the results, default 1.

mprof_barplot

%mprof_barplot [-t TITLE] [--variable {time,memory}] [--barmode {group,stack}] [--groupby {0,1}] profile_ids [profile_ids ...]

Plot only-memory or only-time results in a bar chart. (line_magic)

  • positional arguments:

    • profile_ids
      Profile labels made by mprof_run. Supports regex.
  • optional arguments:

    • -t TITLE, --title TITLE
      String shown as plot title.

    • --variable <{time,memory}>
      Variable to plot, default 'memory'.

    • --barmode <{group,stack}>
      Bar char mode, default 'group'.

    • --groupby <{0,1}>
      Identifier number used to group the results, default 1.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the BSD 3-Clause License. See LICENSE for more information.

Acknowledgements

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

memprofiler-0.1.4.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file memprofiler-0.1.4.tar.gz.

File metadata

  • Download URL: memprofiler-0.1.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for memprofiler-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0e031b4a789909c83666bb93648959df90a85359e763054466b7918884accaa1
MD5 f9c130321263e32e7df5457714ace3ef
BLAKE2b-256 6bf74fd0659892104a4abe7f825048c6a755011f59565ef85d4e57fd86cfff8f

See more details on using hashes here.

Supported by

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