Reference
Public API
- timedb.RETENTION_TIERS = frozenset({'forever', 'long', 'medium', 'short'})
frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object
Build an immutable unordered collection of unique elements.
Profiling helpers
A lightweight phase-timer used by the read/write paths. Useful when diagnosing slow queries or large bulk inserts.
Opt-in per-phase timing collector for TimeDB internal operations.
Disabled by default — zero overhead when disabled (no perf_counter calls,
no function calls in the hot path). Benchmark scripts activate it per-trial
to collect phase-level timing breakdowns.
Not thread-safe; designed for single-threaded benchmark use.
Usage:
from timedb import profiling
profiling.enable() profiling.reset() # … run operation … phases = profiling.collect() # dict of phase -> elapsed seconds profiling.disable()
# Or, for hot-path instrumentation: with profiling._phase(profiling.PHASE_EDB_RESOLVE):
…