bencher.utils_rerun
Rerun SDK integration for bencher — capture live recordings.
This module requires the rerun-sdk package. For functions that work
with pre-recorded .rrd files without the SDK, see utils_rrd.py.
Architecture
Displaying rerun data inside a Panel/Bokeh report requires two pieces:
Data capture —
capture_rerun_rrd()drains the in-memory rerun recording to a complete.rrdfile on disk. Usingrr.save()(which streams to an open file) does NOT work because the file is still being written when the viewer tries to fetch it. Always callrr.log(...)first, thencapture_rerun_rrd()/capture_rerun_window().Viewer —
rrd_file_to_pane()(inutils_rrd.py) writes a small HTML page that loads the@rerun-io/web-viewerfrom CDN and points it at the.rrdfile. Both the viewer page and the data are served by the Panel server at/rrd_static/, keeping everything on the same HTTP origin (no CORS, no extra ports).
Functions
Ensure a rerun recording exists, creating one if needed. |
|
|
Save the current rerun recording to an .rrd file and return the path. |
|
Render the current rerun recording as an inline HTML pane. |
|
Capture the current rerun recording and return the .rrd file path. |
Module Contents
- bencher.utils_rerun._ensure_rerun_init()
Ensure a rerun recording exists, creating one if needed.
- bencher.utils_rerun.capture_rerun_rrd(recording: rerun.RecordingStream | None = None) str
Save the current rerun recording to an .rrd file and return the path.
Data must be logged BEFORE calling this function so that the in-memory recording has content to drain. Calls
rr.init()automatically if no recording exists yet.
- bencher.utils_rerun.rerun_to_pane(width: int = 950, height: int = 712, recording: rerun.RecordingStream | None = None)
Render the current rerun recording as an inline HTML pane.
- bencher.utils_rerun.capture_rerun_window(recording: rerun.RecordingStream | None = None, **_kwargs) str
Capture the current rerun recording and return the .rrd file path.
Data must be logged BEFORE calling this function so that the in-memory recording has content to drain. The returned path is stored by
ResultRerun; rendering into an HTML viewer pane happens later viaResultRerun.to_container().Viewer dimensions (
width/height) are now taken from theResultRerundescriptor. Passing them here is deprecated and they will be ignored.