iops_profiler

IOPS Profiler - Jupyter Magic for measuring I/O operations per second

Submodules

Attributes

__version__

Classes

IOPSProfiler

IPython magic commands for profiling I/O operations per second (IOPS).

Functions

load_ipython_extension(ipython)

Load the extension

unload_ipython_extension(ipython)

Unload the extension

Package Contents

__version__ = '0.0.0+unknown'[source]
class IOPSProfiler(shell)[source]

Bases: IPython.core.magic.Magics

IPython magic commands for profiling I/O operations per second (IOPS).

Provides %iops (line magic) and %%iops (cell magic) commands to measure I/O performance of Python code in Jupyter notebooks.

platform = 'linux'
collector
_profile_code(code, show_histogram=False)[source]

Internal method to profile code with I/O measurements.

Parameters:
  • code – The code string to profile

  • show_histogram – Whether to generate histograms

Returns:

Dictionary with profiling results

iops(line, cell=None)[source]

Measure I/O operations per second for code.

Line magic usage (single line):

%iops open(‘test.txt’, ‘w’).write(‘data’) %iops –histogram open(‘test.txt’, ‘w’).write(‘data’)

Cell magic usage (multiple lines):

%%iops # Your code here with open(‘test.txt’, ‘w’) as f:

f.write(‘data’)

%%iops –histogram # Your code here (with histograms) with open(‘test.txt’, ‘w’) as f:

f.write(‘data’)

load_ipython_extension(ipython)[source]

Load the extension

unload_ipython_extension(ipython)[source]

Unload the extension