Files
2125_GCE/xic_profiler.py
T
2026-07-09 12:54:44 -04:00

27 lines
651 B
Python
Executable File

from contextlib import contextmanager
class XICProfiler:
def reset(self):
print("xic_profiler.reset called")
def report(self):
print("xic_profiler.report called")
@contextmanager
def phase(self, name):
print(f"xic_profiler.phase({name}) started")
try:
yield
finally:
print(f"xic_profiler.phase({name}) ended")
@contextmanager
def span(self, name, meta=None):
print(f"xic_profiler.span({name}, {meta}) started")
try:
yield
finally:
print(f"xic_profiler.span({name}, {meta}) ended")
xic_profiler = XICProfiler()