
    ng\j                     J    S SK Jr  SSKJr  SSSSSS	S
SSSS.
r " S S5      rg)   )	nativestr   )list_to_dict
source_keychunk_countmemory_usagetotal_samplesretention_msecslast_timestampfirst_timestampmax_samples_per_chunk
chunk_sizeduplicate_policy)
	sourceKey
chunkCountmemoryUsagetotalSamplesretentionTimelastTimestampfirstTimestampmaxSamplesPerChunk	chunkSizeduplicatePolicyc                   Z    \ rS rSrSr/ r/ rSrSrSr	Sr
SrSrSrSrSrSrS rS rS rSrg)TSInfo   z
Hold information and statistics on the time-series.
Can be created using ``tsinfo`` command
https://redis.io/docs/latest/commands/ts.info/

Handles both RESP2 (flat list) and RESP3 (dict) responses.
Nc                    [        U[        5      (       aA  UnUR                  S5      =(       d    0 U l        UR                  S5      =(       d    0 U l        Od[        [        [        [        USSS2   5      USSS2   5      5      nUR                  S5      U l        [        UR                  S5      5      U l        UR                  S5      U l	        UR                  S5      U l
        UR                  S5      U l        UR                  S	5      U l        UR                  S
5      U l        UR                  S5      U l        UR                  S5      U l        SU;   a  US   U l        U R                   S-  U l        SU;   a
  US   U l        SU;   aJ  US   U l        [        U R$                  [&        5      (       a   U R$                  R)                  5       U l        ggg)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
ruleslabelsNr   r   r   r   r   r   r   r   r   r      r   r   )
isinstancedictgetr   r   zipmapr   r   r   r   r   r	   r
   r   r   r   r   r   bytesdecode)selfargsresponses      Y/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/redis/commands/timeseries/info.py__init__TSInfo.__init__,   s   H dD!!H!g.4"DJ",,x06BDK CItCaCy 941:FGH!g.DJ&x||H'=>DK",,{3#<<5$LL7%\\.9'||O<&ll?;'||,<=8+)12F)GD&**R/ O ("&{3DO($,->$?D!$//77(,(=(=(D(D(F% 8 )    c                 F     U R                  U5      $ ! [         a     g f = fN)__getitem__AttributeErrorr(   items     r+   r#   
TSInfo.getm   s*    	##D)) 		s    
  c                 @    [        U [        R                  X5      5      $ r0   )getattr_FIELD_ALIASESr#   r3   s     r+   r1   TSInfo.__getitem__s   s    t^//;<<r.   )r   r   r   r   r   r   r   r   r
   r   r   r	   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r	   r
   last_time_stampfirst_time_stampr   r   r   r,   r#   r1   __static_attributes__ r.   r+   r   r      sY     EFIKLMOO J?GB=r.   r   N)helpersr   utilsr   r8   r   rB   r.   r+   <module>rE      s>      !#&%'1)_= _=r.   