TS.INFO key [DEBUG]
Available in: Redis Stack
Time complexity: O(1)
TS.INFO
Format
TS.INFO key [DEBUG]
Description
Returns information and statistics for a time series.
Parameters
- key - Key name of the time series
DEBUG- An optional flag to get a more detailed information about the chunks.
Complexity
O(1)
Return Value
Array-reply, specifically:
totalSamples- Total number of samples in this time seriesmemoryUsage- Total number of bytes allocated for this time seriesfirstTimestamp- First timestamp present in this time serieslastTimestamp- Last timestamp present in this time seriesretentionTime- The retention period, in milliseconds, for this time serieschunkCount- Number of Memory Chunks used for this time serieschunkSize- Memory size, in bytes, allocated for datachunkType- The chunk type:compressedoruncompressedduplicatePolicy- The duplicate policy of this time serieslabels- A nested array of label-value pairs that represent the metadata labels of this time seriessourceKey- Key name for source time series in case the current series is a target of a compaction rulerules- A nested array of the compaction rules defined in this time series
When DEBUG is specified, the response will contain an additional array field called Chunks.
Each item (per chunk) will contain:
startTimestamp- First timestamp present in the chunkendTimestamp- Last timestamp present in the chunksamples- Total number of samples in the chunksize- The chunk data size in bytes (this is the exact size that used for data only inside the chunk, doesn't include other overheads)bytesPerSample- Ratio ofsizeandsamples
TS.INFO Example
TS.INFO temperature:2:32
1) totalSamples
2) (integer) 100
3) memoryUsage
4) (integer) 4184
5) firstTimestamp
6) (integer) 1548149180
7) lastTimestamp
8) (integer) 1548149279
9) retentionTime
10) (integer) 0
11) chunkCount
12) (integer) 1
13) chunkSize
14) (integer) 256
15) chunkType
16) compressed
17) duplicatePolicy
18) (nil)
19) labels
20) 1) 1) "sensor_id"
2) "2"
2) 1) "area_id"
2) "32"
21) sourceKey
22) (nil)
23) rules
24) (empty list or set)
With DEBUG:
...
23) rules
24) (empty list or set)
25) keySelfName
26) "temperature:2:32"
25) Chunks
26) 1) 1) startTimestamp
2) (integer) 1548149180
3) endTimestamp
4) (integer) 1548149279
5) samples
6) (integer) 100
7) size
8) (integer) 256
9) bytesPerSample
10) "1.2799999713897705"