File: //usr/lib/python3.9/site-packages/redis/commands/timeseries/__pycache__/info.cpython-39.pyc
a
��b� � @ s* d dl mZ ddlmZ G dd� d�ZdS )� )� nativestr� )�list_to_dictc @ sH e Zd ZdZg Zg ZdZdZdZdZ dZ
dZdZdZ
dZdZdd� ZdS )�TSInfoz�
Hold information and statistics on the time-series.
Can be created using ``tsinfo`` command
https://oss.redis.com/redistimeseries/commands/#tsinfo.
Nc C s� t ttt|ddd� �|ddd� ��}|d | _|d | _|d | _|d | _|d | _t |d �| _
|d
| _|d | _|d | _
d
|v r�|d
| _| jd | _d|v r�|d | _d|v r�|d | _t| j�tkr�| j�� | _dS )a�
Hold information and statistics on the time-series.
The supported params that can be passed as args:
rules:
A list of compaction rules of the time series.
sourceKey:
Key name for source time series in case the current series
is a target of a rule.
chunkCount:
Number of Memory Chunks used for the time series.
memoryUsage:
Total number of bytes allocated for the time series.
totalSamples:
Total number of samples in the time series.
labels:
A list of label-value pairs that represent the metadata
labels of the time series.
retentionTime:
Retention time, in milliseconds, for the time series.
lastTimestamp:
Last timestamp present in the time series.
firstTimestamp:
First timestamp present in the time series.
maxSamplesPerChunk:
Deprecated.
chunkSize:
Amount of memory, in bytes, allocated for data.
duplicatePolicy:
Policy that will define handling of duplicate samples.
Can read more about on
https://oss.redis.com/redistimeseries/configuration/#duplicate_policy
Nr r �rules� sourceKeyZ
chunkCountZmemoryUsageZtotalSamples�labelsZ
retentionTimeZ
lastTimestampZfirstTimestampZmaxSamplesPerChunk� Z chunkSizeZduplicatePolicy)�dict�zip�mapr r Z
source_key�chunk_count�memory_usage�
total_samplesr r �retention_msecsZ
lastTimeStamp�first_time_stamp�max_samples_per_chunk�
chunk_size�duplicate_policy�type�bytes�decode)�self�argsZresponse� r �B/usr/lib/python3.9/site-packages/redis/commands/timeseries/info.py�__init__ s( $(
�
zTSInfo.__init__)�__name__�
__module__�__qualname__�__doc__r r r r
r r r Zlast_time_stampr r r r r r r r r r s r N)Zhelpersr Zutilsr r r r r r �<module> s