Index
ipw.telemetry
¶
Telemetry collector implementations bundled with Intelligence Per Watt.
AgentEvent
dataclass
¶
Single event recorded during agent execution.
Source code in intelligence-per-watt/src/ipw/telemetry/events.py
EventRecorder
¶
Thread-safe recorder for agent execution events.
Records events with timestamps for later correlation with energy telemetry. All operations are thread-safe for use in concurrent agent execution.
Example
recorder = EventRecorder() recorder.record('tool_call_start', tool='calculator') recorder.record('tool_call_end', tool='calculator') events = recorder.get_events() len(events) 2
Source code in intelligence-per-watt/src/ipw/telemetry/events.py
__init__()
¶
record(event_type, **metadata)
¶
Record an event with current timestamp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_type
|
str
|
Type of event (e.g., 'tool_call_start', 'lm_inference_end') |
required |
**metadata
|
Any
|
Additional metadata to attach to the event |
{}
|
Source code in intelligence-per-watt/src/ipw/telemetry/events.py
get_events()
¶
Return a copy of all recorded events.
Returns:
| Type | Description |
|---|---|
List[AgentEvent]
|
List of all recorded events in chronological order. |
clear()
¶
EventType
¶
Bases: str, Enum
Supported event types for agent telemetry.
Source code in intelligence-per-watt/src/ipw/telemetry/events.py
ensure_monitor(target=DEFAULT_TARGET, *, timeout=5.0, launch=True, launch_args=None, env=None)
¶
Ensure a monitor is reachable, optionally launching one in the background.
Yields the normalized target string. If launch is True, a background
process will be spawned when the target is unavailable. The caller is
responsible for any teardown when the context exits.
Source code in intelligence-per-watt/src/ipw/telemetry/launcher.py
wait_for_ready(target=DEFAULT_TARGET, *, timeout=5.0)
¶
Return True when the energy monitor responds to a health check.