Utilities API¶
See also
For complete class and member documentation, see the API Reference.
Composable processing utilities. For usage examples, see Utilities.
Base Classes¶
All utilities inherit from UtilityBase, which provides tag introspection,
context management, and naming. Two derived templates define the process()
contract:
Utility<I, O, Tags...>— materialized output:process()returnsCoroTask<O>StreamingUtility<I, Batch, Tags...>— streaming output:process()returnsAsyncGenerator<Batch>
classDiagram
class UtilityBase~I, Tags~ {
+has_tag~Tag~() bool
+get_tag~Tag~() Tag
+get_name() string
+set_name(string)
#context() CoroScope
}
class Utility~I, O, Tags~ {
+process(I) CoroTask~O~
}
class StreamingUtility~I, Batch, Tags~ {
+process(I) AsyncGenerator~Batch~
}
UtilityBase <|-- Utility
UtilityBase <|-- StreamingUtility
UtilityBase¶
Shared base for all utilities. Provides tag introspection (has_tag<>,
get_tag<>), context management (context() for NeedsContext
utilities), and name/type signature generation.
Utility (Materialized)¶
For utilities that compute a single result. process() returns
CoroTask<O> — the caller co_awaits the result.
StreamingUtility¶
For utilities that yield results incrementally. process() returns
AsyncGenerator<Batch> — the caller iterates with
co_await gen.next().
Batch structs typically provide a to_arrow() method for Arrow
conversion (e.g., ViewReaderBatch::to_arrow(),
AggregationBatch::to_arrow()).
// Consuming a StreamingUtility
ViewReaderUtility reader;
auto gen = reader.process(input);
while (auto batch = co_await gen.next()) {
// Use C++ data directly
for (const auto& event : batch->events) { ... }
// Or convert to Arrow
auto arrow = batch->to_arrow();
}
Module Reference¶
Each module below has detailed class documentation in the API Reference:
Module |
Description |
API Reference |
|---|---|---|
Call Tree |
Build hierarchical call trees from DFTracer traces |
|
Filesystem |
Directory scanning utilities |
|
File I/O |
File reading, writing, chunk writing, async line generators |
|
Compression |
Streaming zlib compression (GZIP, ZLIB, DEFLATE) |
|
Text |
Line splitting, filtering, text processing |
|
Hash |
FNV1a, std::hash, MT-safe hasher utilities |
|
Statistics |
DDSketch (percentiles), Log2Histogram (distributions) |
|
Indexer |
Bloom filter indexes, manifests, provenance tracking |
|
Reader |
Streaming trace file reader with index support |
|
Views |
View definitions and predicate-based event filtering |
|
Aggregation |
Time-bucketed aggregation pipeline with Arrow output |
|
Comparator |
Baseline vs variant trace comparison with Cohen’s d |
|
Reorganization |
Parallel event routing and chunked output |
|
Replay |
Replay I/O operations from traces |