Skip to content

Comments

Add granular I/O tracking for Windows with Python-level interception#13

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/get-granular-data-windows
Draft

Add granular I/O tracking for Windows with Python-level interception#13
Copilot wants to merge 5 commits intomainfrom
copilot/get-granular-data-windows

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

Windows lacked per-operation I/O data, preventing histogram visualization that Linux (strace) and macOS (fs_usage) provided.

Changes

Core Implementation

  • Added _measure_windows_python_io() that intercepts builtins.open with an IOTracker wrapper class
  • Wrapper tracks individual read(), write(), readline(), readlines(), writelines() calls and iteration
  • Returns operation list with {'type': 'read'/'write', 'bytes': N} for histogram generation
  • Updated _measure_linux_windows() to accept collect_ops parameter and delegate to tracking when enabled

Platform Coverage

  • Linux: strace (system-level syscalls) or psutil fallback
  • macOS: fs_usage (system-level file operations)
  • Windows: Python-level tracking via open() interception

Limitations

  • Captures Python open() calls only, not native C extensions
  • Sufficient for pure Python workloads

Example

%%iops --histogram
with open('data.txt', 'w') as f:
    f.write('A' * 100)
    f.write('B' * 500)
    f.write('C' * 1000)

Now generates histograms on Windows showing operation count and bytes distribution by operation size.

Documentation

  • Updated README with platform-specific tracking methods and Windows limitations
Original prompt

This section details on the original issue you should resolve

<issue_title>Find a way to get granular (per operation) data on Windows</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits November 5, 2025 03:48
Co-authored-by: mtauraso <31012+mtauraso@users.noreply.github.com>
Co-authored-by: mtauraso <31012+mtauraso@users.noreply.github.com>
Co-authored-by: mtauraso <31012+mtauraso@users.noreply.github.com>
Co-authored-by: mtauraso <31012+mtauraso@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to retrieve granular operation data on Windows Add granular I/O tracking for Windows with Python-level interception Nov 5, 2025
Copilot AI requested a review from mtauraso November 5, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Find a way to get granular (per operation) data on Windows

2 participants