chronon::observe::ObservationFilter
Fast O(1) bitmask-based filtering for observability events. More...
#include <ObservationFilter.hpp>
Public Classes
| Name | |
|---|---|
| struct | CategoryTemporalConfig Temporal filters scoped to a specific category. |
Public Types
| Name | |
|---|---|
| using std::pair< uint64_t, uint64_t > | CycleRange |
Public Functions
| Name | |
|---|---|
| bool | shouldObserveCategory(CategoryMask category_mask, uint64_t cycle) const Category check plus global and per-category temporal filtering. |
| bool | shouldObserve(CategoryMask category_mask) const Hot path: ~2ns. |
| bool | shouldObserve(CategoryMask category_mask, uint64_t cycle) const Category check plus global cycle-range filtering. |
| void | setMinLogLevel(LogLevel level) |
| void | setEnabledCategories(CategoryMask mask) |
| void | setCategoryTemporalConfig(CategoryMask category_mask, const CategoryTemporalConfig & config) |
| void | reset() |
| CategoryMask | getEnabledCategories() const |
| void | enableCategory(CategoryMask mask) |
| void | disableCategory(CategoryMask mask) |
| void | clearPeriodicFilters() |
| void | clearCycleRanges() |
| void | clearCategoryTemporalConfig(CategoryMask category_mask) |
| void | clearAllCategoryTemporalConfigs() |
| bool | anyEnabled() const First-check guard so callers can skip all observation logic when nothing is enabled. |
| void | addPeriodicFilter(uint64_t window, uint64_t period, uint64_t offset =0) |
| void | addCycleRange(uint64_t start, uint64_t end) |
| void | addCategoryRange(CategoryMask category_mask, uint64_t start, uint64_t end) |
| void | addCategoryPeriodicFilter(CategoryMask category_mask, uint64_t window, uint64_t period, uint64_t offset =0) |
| ObservationFilter() =default |
Detailed Description
class chronon::observe::ObservationFilter;
Fast O(1) bitmask-based filtering for observability events.
Hot path is a single atomic load + AND. Safe for concurrent reads; configuration changes should happen before simulation start or during quiescent periods.
Public Types Documentation
using CycleRange
using chronon::observe::ObservationFilter::CycleRange = std::pair<uint64_t, uint64_t>;
Public Functions Documentation
function shouldObserveCategory
inline bool shouldObserveCategory(
CategoryMask category_mask,
uint64_t cycle
) const
Category check plus global and per-category temporal filtering.
Prefer this over shouldObserve() when per-category temporal configs are in use.
function shouldObserve
inline bool shouldObserve(
CategoryMask category_mask
) const
Hot path: ~2ns.
function shouldObserve
inline bool shouldObserve(
CategoryMask category_mask,
uint64_t cycle
) const
Category check plus global cycle-range filtering.
function setMinLogLevel
inline void setMinLogLevel(
LogLevel level
)
function setEnabledCategories
inline void setEnabledCategories(
CategoryMask mask
)
function setCategoryTemporalConfig
inline void setCategoryTemporalConfig(
CategoryMask category_mask,
const CategoryTemporalConfig & config
)
function reset
inline void reset()
function getEnabledCategories
inline CategoryMask getEnabledCategories() const
function enableCategory
inline void enableCategory(
CategoryMask mask
)
function disableCategory
inline void disableCategory(
CategoryMask mask
)
function clearPeriodicFilters
inline void clearPeriodicFilters()
function clearCycleRanges
inline void clearCycleRanges()
function clearCategoryTemporalConfig
inline void clearCategoryTemporalConfig(
CategoryMask category_mask
)
function clearAllCategoryTemporalConfigs
inline void clearAllCategoryTemporalConfigs()
function anyEnabled
inline bool anyEnabled() const
First-check guard so callers can skip all observation logic when nothing is enabled.
function addPeriodicFilter
inline void addPeriodicFilter(
uint64_t window,
uint64_t period,
uint64_t offset =0
)
function addCycleRange
inline void addCycleRange(
uint64_t start,
uint64_t end
)
Parameters:
- start Inclusive.
- end Inclusive.
function addCategoryRange
inline void addCategoryRange(
CategoryMask category_mask,
uint64_t start,
uint64_t end
)
function addCategoryPeriodicFilter
inline void addCategoryPeriodicFilter(
CategoryMask category_mask,
uint64_t window,
uint64_t period,
uint64_t offset =0
)
function ObservationFilter
ObservationFilter() =default
Updated on 2026-05-26 at 05:42:33 +0000