pytimber.SparkLoggingDB.get_data_using_snapshots
- SparkLoggingDB.get_data_using_snapshots(pattern_or_list: str | Iterable[str], owner_pattern: str = '%', unix_time: bool = True, search_criteria: Dict[str, str] | None = None, t1: str | datetime | datetime64 | timedelta | int | int64 | float = None, t2: str | datetime | datetime64 | timedelta | int | int64 | float | None = None) Dict[str, Dict[str, T]]
Get data for variables attached to snapshots which are selected by provided list of strings or pattern in a time window defined in the snapshot configuration
- Parameters:
pattern_or_list – pattern for the selection of snapshot names or a list of snapshot names
owner_pattern – pattern for the filtering by owner name
unix_time – Whether to return POSIX timestamps as float values. If True, return POSIX timestamps. If False, return datetime objects. Default value is True.
search_criteria –
a dictionary representing snapshot properties, for example: {
’getTimeZone’: ‘UTC_TIME’, ‘isEndTimeDynamic’: ‘false’, ‘getEndTime’: ‘2050-01-01 00:00:00.000’, ‘getStartTime’: ‘2023-01-01 00:00:00.000’, ‘fundamentalFilter’: f’{{“accelerator”: “ACC”, “lsaCycle”: “CYCLE%”, “timingUser”: “USER%”}}’,
},
t1 – The start time of the time window, as a str, datetime, datetime64, timedelta, int, int64. Default value is None.
t2 –
The end time of the time window, as a str, datetime, datetime64, timedelta, int, int64 or a strategy.
Cannot specify search_criteria and t1/t2 at the same time.
If t1/t2 specified, it overrides the time range calculated from the stored snapshot definition. If t2 is missing, None, “last”, the last data point before t1 is given If t2 is “last”, the last data point before t1 is given. If t2 is “next”, the first data point after t1 is given. If t2 is a timestamp or a datetime object, the data within the time window [t1, t2] is returned. Default value is None.
- Returns:
A dictionary of snapshots names having dictionaries of variables with corresponding data for a given time period