
    Pf                     8    d dl mZ ddlmZ  G d d          ZdS )   )	nativestr   )list_to_dictc                   T    e Zd ZdZg Zg ZdZdZdZdZ	dZ
dZdZdZdZdZd Zd Zd ZdS )TSInfoz
    Hold information and statistics on the time-series.
    Can be created using ``tsinfo`` command
    https://redis.io/docs/latest/commands/ts.info/
    Nc                 z   t          t          t          t          |ddd                   |ddd                             }|                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _        |                    d          | _	        t          |                    d	                    | _        |                    d
          | _        |                    d          | _        |                    d          | _        d|v r|d         | _        | j        dz  | _        d|v r|d         | _        d|v rJ|d         | _        t%          | j                  t&          k    r"| j                                        | _        dS dS dS )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://redis.io/docs/latest/develop/data-types/timeseries/configuration/#duplicate_policy
        Nr   r   rules	sourceKey
chunkCountmemoryUsagetotalSampleslabelsretentionTimelastTimestampfirstTimestampmaxSamplesPerChunk   	chunkSizeduplicatePolicy)dictzipmapr   getr	   
source_keychunk_countmemory_usagetotal_samplesr   r   retention_msecslast_timestampfirst_timestampmax_samples_per_chunk
chunk_sizeduplicate_policytypebytesdecode)selfargsresponses      P/var/www/html/env/lib/python3.11/site-packages/redis/commands/timeseries/info.py__init__zTSInfo.__init__   s   H C	4!955tADqDzBBCC\\'**
",,{33#<<55$LL77%\\.99"8<<#9#9::'||O<<&ll?;;'||,<==8++)12F)GD&*R/ O (""&{3DO(($,->$?D!D)**e33(,(=(D(D(F(F%%% )(33    c                 P    	 |                      |          S # t          $ r Y d S w xY wN)__getitem__AttributeErrorr'   items     r*   r   z
TSInfo.getT   s=    	##D))) 	 	 	44	s    
%%c                 "    t          | |          S r.   )getattrr1   s     r*   r/   zTSInfo.__getitem__Z   s    tT"""r,   )__name__
__module____qualname____doc__r	   r   r
   r   r   r   r   last_time_stampfirst_time_stampr!   r"   r#   r+   r   r/    r,   r*   r   r      s          EFIKLMOO J8G 8G 8Gt  # # # # #r,   r   N)helpersr   utilsr   r   r;   r,   r*   <module>r>      se               V# V# V# V# V# V# V# V# V# V#r,   