"""Possible Statistics found from the Archiver and related services."""
from __future__ import annotations
import enum
from dataclasses import dataclass
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from epicsarchiver.statistics.models.stat_responses import BaseStatResponse
[docs]
class Stat(str, enum.Enum):
"""List of statistics from the archiver.
Args:
enum (Stat): A statistic on pvs in archiver
"""
[docs]
BufferOverflow = "PV updating faster than the sampling period."
[docs]
TypeChange = "PV changed type, which archiver hasn't been updated for."
[docs]
IncorrectTimestamp = "PV loses events due to incorrect timestamps."
[docs]
SlowChanging = "More events lost than stored."
[docs]
DisconnectedPVs = "PV disconnected for a long time."
[docs]
SilentPVs = "Never received a valid event."
[docs]
DoubleArchived = "Archived in both clusters."
[docs]
StorageRates = "In the top storage rates."
[docs]
LostConnection = "In the top dropped connections."
[docs]
InvalidName = "PV has name that should not be archived"
@dataclass
[docs]
class PVStats:
"""Statistics of a PV.
name: PV Name
stats: Dictionary of Statistic type to BaseStatResponse with more details.
"""
[docs]
stats: dict[Stat, BaseStatResponse]