epicsarchiver.statistics.models.pv_details

Handles the PVDetails report per PV from the Archiver.

Classes

DetailEnum

Enum of detail types present in the archiver per PV.

Details

Representation of the response from the pvDetails endpoint in archiver.

Functions

_dropped_pv_response(...)

Module Contents

class epicsarchiver.statistics.models.pv_details.DetailEnum[source]

Bases: str, enum.Enum

Enum of detail types present in the archiver per PV.

PVName = 'PV Name'[source]
DBRType = 'Archiver DBR type (from typeinfo):'[source]
PVAccess = 'Are we using PVAccess?'[source]
Method = 'Sampling method:'[source]
Period = 'Sampling period:'[source]
Capacity = 'Sample buffer capacity'[source]
EventRate = 'Estimated event rate (events/sec)'[source]
EventsLost = 'How many events lost totally so far?'[source]
TotalEvents = 'How many events so far?'[source]
Connnected = 'Is this PV currently connected?'[source]
LastLostConnection = 'When did we last lose a connection to this PV?'[source]
LostConnections = 'How many times have we lost and regained the connection to this PV?'[source]
LostEventsTimestamp = 'How many events lost because the timestamp is in the far future or past so far?'[source]
LostEventsBuffer = 'How many events lost because the sample buffer is full so far?'[source]
LostEventsType = 'How many events lost because the DBR_Type of the PV has changed from what it used to be?'[source]
MBStorageRate = 'Estimated storage rate (MB/day)'[source]
LastEvent = 'When did we receive the last event?'[source]
Hostname = 'Hostname of PV from CA'[source]
Instance = 'Instance archiving PV'[source]
CommandThread = 'The CAJ command thread id'[source]
classmethod from_str(desc: str) DetailEnum | None[source]

Convert from a string to DetailEnum.

Parameters:

desc (str) – input string

Returns:

An enum representation.

Return type:

DetailEnum | None

epicsarchiver.statistics.models.pv_details._dropped_pv_response(pv_name: str, value: str, reason: epicsarchiver.statistics.models.stat_responses.DroppedReason, stat: epicsarchiver.statistics.models.stats.Stat) tuple[epicsarchiver.statistics.models.stats.Stat, epicsarchiver.statistics.models.stat_responses.DroppedPVResponse] | None[source]
class epicsarchiver.statistics.models.pv_details.Details[source]

Bases: Dict[DetailEnum, str]

Representation of the response from the pvDetails endpoint in archiver.

classmethod from_json(json: list[dict[str, str]]) Details[source]

Convert from the json representation at the Archiver Endpoint.

Takes some of the details which are relevant for reports to create Details.

Parameters:

json (list[dict[str, str]]) – input json

Returns:

dictionary of DetailEnum to string value.

Return type:

Details

to_base_responses(mb_per_day_min: float = 0) dict[epicsarchiver.statistics.models.stats.Stat, epicsarchiver.statistics.models.stat_responses.BaseStatResponse][source]

Convert to a BaseStatResponse dict to match Generic Archiver Statistics.

Parameters:

mb_per_day_min (float) – Minimum MB per day to filter by

Returns:

Stat to BaseStatResponse output

Return type:

dict[Stat, BaseStatResponse]

detail_to_base_response(detail_enum: DetailEnum, value: str, mb_per_day_min: float = 0) tuple[epicsarchiver.statistics.models.stats.Stat, epicsarchiver.statistics.models.stat_responses.BaseStatResponse] | None[source]

Convert a single detail to a Stat and BaseStatResponse.

Parameters:
  • detail_enum (DetailEnum) – Detail

  • value (str) – String value of the detail

  • mb_per_day_min (float) – Minimum MB per day to filter by

Returns:

Output

Return type:

tuple[Stat, BaseStatResponse] | None