content/commands/ts.info.md
Return information and statistics for a time series.
is an optional flag to get a more detailed information about the chunks.
</details>| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="ts-info-return-info" tab1="RESP2" tab2="RESP3" >}}
[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with information about the time series as flattened name-value pairs:
| Name
| [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) | Description |
|---|---|
totalSamples | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) |
| Total number of samples in this time series | |
memoryUsage | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) |
| Total number of bytes allocated for this time series, which is the sum of |
firstTimestamp | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})
First timestamp present in this time series (Unix timestamp in milliseconds)
| lastTimestamp | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})
Last timestamp present in this time series (Unix timestamp in milliseconds)
| retentionTime | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})
The retention period, in milliseconds, for this time series
| chunkCount | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})
Number of chunks used for this time series
| chunkSize | [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}})
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]({{< relref "commands/ts.alter/" >}})) does not affect existing chunks.
| chunkType | [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})
The chunks type: compressed or uncompressed
| duplicatePolicy | [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) or [Nil reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})
The [duplicate policy]({{< relref "develop/data-types/timeseries/configuration#duplicate_policy" >}}) of this time series
| labels | [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) or [Nil reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})
Metadata labels of this time series
Each element is a 2-elements [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of ([Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}), [Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})) representing (label, value)
| sourceKey | [Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) or [Nil reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})
Key name for source time series in case the current series is a target of a [compaction rule]({{< relref "commands/ts.createrule" >}})
| rules | [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}})
[Compaction rules]({{< relref "commands/ts.createrule" >}}) defined in this time series
Each rule is an [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with 4 elements:When [DEBUG]({{< relref "/commands/debug" >}}) is specified, the response also contains:
| Name
| [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) | Description |
|---|---|
keySelfName | [Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) |
| Name of the key | |
Chunks | [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with information about the chunks |
| Each element is an [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of information about a single chunk in a name([Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}))-value pairs: |
startTimestamp - [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - First timestamp present in the chunkendTimestamp - [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - Last timestamp present in the chunksamples - [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - Total number of samples in the chunksize - [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the chunk's internal data size (without overheads) in bytesbytesPerSample - [Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) (double) - Ratio of size and samples-tab-sep-
[Map reply]({{< relref "/develop/reference/protocol-spec#maps" >}}) with information about the time series. The map contains the same fields as described in the RESP2 response, but organized as key-value pairs in a map structure rather than a flattened array.
When [DEBUG]({{< relref "/commands/debug" >}}) is specified, the response also contains the additional keySelfName and Chunks fields as described above.
{{< /multitabs >}}
Create a set of sensors to measure temperature and humidity in your study and kitchen.
{{< highlight bash >}} 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 {{< / highlight >}}
Find information about the time series for temperature in the kitchen.
{{< highlight bash >}} 127.0.0.1:6379> TS.INFO telemetry:kitchen:temperature
Query the time series using DEBUG to get more information about the chunks.
{{< highlight bash >}} 127.0.0.1:6379> TS.INFO telemetry:kitchen:temperature DEBUG
[TS.RANGE]({{< relref "commands/ts.range/" >}}) | [TS.QUERYINDEX]({{< relref "commands/ts.queryindex/" >}}) | [TS.GET]({{< relref "commands/ts.get/" >}})
[RedisTimeSeries]({{< relref "/develop/data-types/timeseries/" >}})