Skip to content

Expose detailed I/O data via magic variable #47

@mtauraso

Description

@mtauraso

Expose detailed I/O data via magic variable

Implementation

After %%iops execution, inject a variable iops_detailed_data into the user's namespace via:

self.shell.user_ns['iops_detailed_data'] = detailed_data

Variable Content

When detailed data is available (strace/fs_usage modes):

  • Type: pandas.DataFrame
  • Columns:
    • path (str): File path
    • operation (str): "read" or "write"
    • syscall (str, optional): Syscall name if available
    • size_bytes (int): Bytes transferred

When detailed data is NOT available (psutil mode):

  • Type: str
  • Value: "Detailed I/O data not available: profiling uses psutil mode which only provides aggregate metrics"

Documentation

Add a brief note to README.md showing users can access iops_detailed_data after running %%iops.

Example

%%iops
with open('test.txt', 'w') as f:
    f.write('data')

Next cell:

iops_detailed_data  # Access the DataFrame

Also update readthedocs.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions