epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval
Module for an asynchronous version of archiver retriever.
Classes
Async retrieval client for the EPICS archiver appliance. |
Functions
|
Module Contents
- epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval._format_date(at: datetime.datetime) str[source]
- class epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval.AsyncArchiverRetrieval(hostname: str = 'localhost', port: int = 17665)[source]
Bases:
epicsarchiver.common.async_service.ServiceClientAsync retrieval client for the EPICS archiver appliance.
Hold a session to the Archiver Appliance server to make retrieval requests.
- Parameters:
hostname – EPICS Archiver Appliance hostname [default: localhost]
port – EPICS Archiver Appliance management port [default: 17665]
Examples:
from epicsarchiver.archiver.retrieval import AsyncArchiverRetrieval async with AsyncArchiverRetrieval("archiver-01.tn.esss.lu.se") as archappl: events = await archappl.get_events( "my:pv", start=datetime.now(tz=UTC) - timedelta(seconds=1), end=datetime.utcnow(), )
- async data_url() str[source]
EPICS Archiver Appliance data retrieval URL.
- Raises:
ArchiverResponseError – Raises if archiver not available
- Returns:
URL of retrieval engine
- Return type:
- async _get_data_raw(pv: str, start: datetime.datetime, end: datetime.datetime) aiohttp.ClientResponse[source]
Fetch raw response from archiver data retrieval URL.
- Parameters:
pv (str) – PV data requested for.
start (datetime.datetime) – Start time of period.
end (datetime.datetime) – End time of period.
- Returns:
Raw response from the archiver.
- Return type:
ClientResponse
- async get_events(pv: str, start: datetime.datetime, end: datetime.datetime, processor: epicsarchiver.retrieval.archiver_retrieval.processor.Processor | None = None) list[epicsarchiver.retrieval.archive_event.ArchiveEvent][source]
Get a list of events from the archiver for specified pv and time period.
- Parameters:
pv (str) – PV data requested for.
start (datetime.datetime) – Start time of the time period.
end (datetime.datetime) – End time fo the time period.
processor (Processor | None, optional) – Optional Preprocessor to use. Defaults to None.
- Returns:
List of events in time period.
- Return type:
- async get_all_events(pvs: set[str], start: datetime.datetime, end: datetime.datetime, processor: epicsarchiver.retrieval.archiver_retrieval.processor.Processor | None = None) dict[str, list[epicsarchiver.retrieval.archive_event.ArchiveEvent]][source]
Get a list of events for every pv requested.
Makes all the calls to the archiver asynchronously, so some maybe made in parallel.
- Parameters:
start (datetime.datetime) – Start time of period.
end (datetime.datetime) – End time of period.
processor (Processor | None, optional) – Optional choice of Preprocessor. Defaults to None.
- Returns:
Dictionary of pvs (keys) and events (values).
- Return type:
dict[str, list[ArchiveEvent]]