Package panopticon
Defines the external facing API for usage in code
Expand source code
#!/bin/env python3
"""Defines the external facing API for usage in code"""
from contextlib import contextmanager
import panopticon.trace
import panopticon.version
from panopticon.tracer import AsyncioTracer
__version__ = panopticon.version.version
@contextmanager
def record_trace(trace_file: str):
with open(trace_file, "w") as out:
with AsyncioTracer(trace=panopticon.trace.StreamingTrace(out)):
yield
Sub-modules
panopticon.post
-
Utilities for post-processing traces for legibility
panopticon.probe
-
A lighter probe implementation.
panopticon.trace
-
Classes to generate a tracefile in the right format
panopticon.tracer
-
The actual tracer
panopticon.version
-
Used across setup tools and init: keep this minimal.
Functions
def record_trace(trace_file: str)
-
Expand source code
@contextmanager def record_trace(trace_file: str): with open(trace_file, "w") as out: with AsyncioTracer(trace=panopticon.trace.StreamingTrace(out)): yield