docs/v3/api-ref/python/prefect-server-events-counting.mdx
prefect.server.events.countingInvalidEventCountParameters <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L26" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Raised when the given parameters are invalid for counting events.
TimeUnit <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L34" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
as_timedelta <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L41" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>as_timedelta(self, interval: float) -> Duration
auto <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/utilities/collections.py#L70" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>auto() -> str
Exposes enum.auto() to avoid requiring a second import to use AutoEnum
database_label_expression <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L145" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>database_label_expression(self, db: PrefectDBInterface, time_interval: float) -> sa.Function[str]
Returns the SQL expression to label a time bucket
database_value_expression <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L110" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>database_value_expression(self, time_interval: float) -> sa.Cast[str]
Returns the SQL expression to place an event in a time bucket
get_interval_spans <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L78" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>get_interval_spans(self, start_datetime: datetime.datetime, end_datetime: datetime.datetime, interval: float) -> Generator[int | tuple[datetime.datetime, datetime.datetime], None, None]
Divide the given range of dates into evenly-sized spans of interval units
validate_buckets <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_buckets(self, start_datetime: datetime.datetime, end_datetime: datetime.datetime, interval: float) -> None
Countable <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L175" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
auto <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/utilities/collections.py#L70" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>auto() -> str
Exposes enum.auto() to avoid requiring a second import to use AutoEnum
get_database_query <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/counting.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>get_database_query(self, filter: 'EventFilter', time_unit: TimeUnit, time_interval: float) -> Select[tuple[str, str, DateTime, DateTime, int]]