Other classes and functions
rerun
class RecordingStream
A RecordingStream is used to send data to Rerun.
You can instantiate a RecordingStream by calling either rerun.init
(to create a global
recording) or rerun.new_recording
(for more advanced use cases).
Multithreading
A RecordingStream can safely be copied and sent to other threads.
You can also set a recording as the global active one for all threads (rerun.set_global_data_recording
)
or just for the current thread (rerun.set_thread_local_data_recording
).
Similarly, the with
keyword can be used to temporarily set the active recording for the
current thread, e.g.:
with rec:
rr.log(...)
See also: rerun.get_data_recording
, rerun.get_global_data_recording
,
rerun.get_thread_local_data_recording
.
Available methods
Every function in the Rerun SDK that takes an optional RecordingStream as a parameter can also be called as a method on RecordingStream itself.
This includes, but isn't limited to:
- Metadata-related functions:
rerun.is_enabled
,rerun.get_recording_id
, … - Sink-related functions:
rerun.connect
,rerun.spawn
, … - Time-related functions:
rerun.set_time_seconds
,rerun.set_time_sequence
, … - Log-related functions:
rerun.log
,rerun.log_components
, …
For an exhaustive list, see help(rerun.RecordingStream)
.
Micro-batching
Micro-batching using both space and time triggers (whichever comes first) is done automatically in a dedicated background thread.
You can configure the frequency of the batches using the following environment variables:
RERUN_FLUSH_TICK_SECS
: Flush frequency in seconds (default:0.05
(50ms)).RERUN_FLUSH_NUM_BYTES
: Flush threshold in bytes (default:1048576
(1MiB)).RERUN_FLUSH_NUM_ROWS
: Flush threshold in number of rows (default:18446744073709551615
(u64::MAX)).
class LoggingHandler
Bases: Handler
Provides a logging handler that forwards all events to the Rerun SDK.
Read more about logging handlers.
def __init__ (path_prefix=None)
Initializes the logging handler with an optional path prefix.
PARAMETER | DESCRIPTION |
---|---|
path_prefix |
A common prefix for all logged entity paths. Defaults to no prefix.
TYPE:
|
def emit (record)
Emits a record to the Rerun SDK.