TS.INFO
Syntax
TS.INFO key [DEBUG]
- Available in:
- Redis Stack / TimeSeries 1.0.0
- Time complexity:
- O(1)
Return information and statistics for a time series.
Required arguments
key
is key name of the time series.
Optional arguments
[DEBUG]
is an optional flag to get a more detailed information about the chunks.
Return value
Array reply with information about the time series (name-value pairs):
Name Simple string reply |
Description |
---|---|
totalSamples |
Integer reply Total number of samples in this time series |
memoryUsage |
Integer reply Total number of bytes allocated for this time series, which is the sum of - The memory used for storing the series' configuration parameters (retention period, duplication policy, etc.) - The memory used for storing the series' compaction rules - The memory used for storing the series' labels (key-value pairs) - The memory used for storing the chunks (chunk header + compressed/uncompressed data) |
firstTimestamp |
Integer reply First timestamp present in this time series (Unix timestamp in milliseconds) |
lastTimestamp |
Integer reply Last timestamp present in this time series (Unix timestamp in milliseconds) |
retentionTime |
Integer reply The retention period, in milliseconds, for this time series |
chunkCount |
Integer reply Number of chunks used for this time series |
chunkSize |
Integer reply The initial allocation size, in bytes, for the data part of each new chunk. Actual chunks may consume more memory. Changing the chunk size (using TS.ALTER ) does not affect existing chunks. |
chunkType |
Simple string reply The chunks type: compressed or uncompressed |
duplicatePolicy |
Simple string reply or Null reply The duplicate policy of this time series |
labels |
Array reply or Null reply Metadata labels of this time series Each element is a 2-elements Array reply of (Bulk string reply, Bulk string reply) representing (label, value) |
sourceKey |
Bulk string reply or Null reply Key name for source time series in case the current series is a target of a compaction rule |
rules |
Array reply Compaction rules defined in this time series Each rule is an Array reply with 4 elements: - Bulk string reply: The compaction key - Integer reply: The bucket duration - Simple string reply: The aggregator - Integer reply: The alignment (since RedisTimeSeries v1.8) |
When DEBUG
is specified, the response also contains:
Name Simple string reply |
Description |
---|---|
keySelfName |
Bulk string reply Name of the key |
Chunks |
Array reply with information about the chunks Each element is an Array reply of information about a single chunk in a name(Simple string reply)-value pairs: - startTimestamp - Integer reply - First timestamp present in the chunk- endTimestamp - Integer reply - Last timestamp present in the chunk- samples - Integer reply - Total number of samples in the chunk- size - Integer reply - the chunk's internal data size (without overheads) in bytes- bytesPerSample - Bulk string reply (double) - Ratio of size and samples |
Examples
Find information about a temperature/humidity time series by location and sensor type
Create a set of sensors to measure temperature and humidity in your study and kitchen.
127.0.0.1:6379> TS.CREATE telemetry:study:temperature LABELS room study type temperature
OK
127.0.0.1:6379> TS.CREATE telemetry:study:humidity LABELS room study type humidity
OK
127.0.0.1:6379> TS.CREATE telemetry:kitchen:temperature LABELS room kitchen type temperature
OK
127.0.0.1:6379> TS.CREATE telemetry:kitchen:humidity LABELS room kitchen type humidity
OK
Find information about the time series for temperature in the kitchen.
127.0.0.1:6379> TS.INFO telemetry:kitchen:temperature
1) totalSamples
2) (integer) 0
3) memoryUsage
4) (integer) 4246
5) firstTimestamp
6) (integer) 0
7) lastTimestamp
8) (integer) 0
9) retentionTime
10) (integer) 0
11) chunkCount
12) (integer) 1
13) chunkSize
14) (integer) 4096
15) chunkType
16) compressed
17) duplicatePolicy
18) (nil)
19) labels
20) 1) 1) "room"
2) "kitchen"
2) 1) "type"
2) "temperature"
21) sourceKey
22) (nil)
23) rules
24) (empty array)
Query the time series using DEBUG to get more information about the chunks.
127.0.0.1:6379> TS.INFO telemetry:kitchen:temperature DEBUG
1) totalSamples
2) (integer) 0
3) memoryUsage
4) (integer) 4246
5) firstTimestamp
6) (integer) 0
7) lastTimestamp
8) (integer) 0
9) retentionTime
10) (integer) 0
11) chunkCount
12) (integer) 1
13) chunkSize
14) (integer) 4096
15) chunkType
16) compressed
17) duplicatePolicy
18) (nil)
19) labels
20) 1) 1) "room"
2) "kitchen"
2) 1) "type"
2) "temperature"
21) sourceKey
22) (nil)
23) rules
24) (empty array)
25) keySelfName
26) "telemetry:kitchen:temperature"
27) Chunks
28) 1) 1) startTimestamp
2) (integer) 0
3) endTimestamp
4) (integer) 0
5) samples
6) (integer) 0
7) size
8) (integer) 4096
9) bytesPerSample
10) "inf"
See also
TS.RANGE
| TS.QUERYINDEX
| TS.GET