rpk topic analyze
Analyze topics.
This command consumes records from the specified topics to determine topic characteristics such as batch rate and batch size.
To print all of the metadata collected, use the --format flag with either JSON or YAML.
Usage
rpk topic analyze <topic> [flags]
Topics
Topics can either be listed individually or by regex via the --regex flag (-r).
For example,
| Value | Description |
|---|---|
|
|
|
|
|
|
|
Time Range
The --time-range flag specifies the time range to consume from.
Use the following format:
t1:t2 consume from timestamp t1 until timestamp t2
There are a few options for the timestamp syntax. rpk evaluates each option
until one succeeds:
| Value | Description |
|---|---|
|
parsed as a Unix millisecond |
|
parsed as a Unix second |
|
parsed as a day, UTC |
|
parsed as RFC3339, UTC; fractional seconds optional (.MMM) |
|
for t2 in @t1:t2, the current end of the partition |
|
a negative duration from now or from a timestamp |
|
a positive duration from now or from a timestamp |
Durations can be relative to the current time or relative to a timestamp. If a duration is used for t1, that duration is relative to now. If a duration is used for t2, and t1 is a timestamp, then t2 is relative to t1. If a duration is used for t2, and t1 is a duration, then t2 is relative to now.
Durations are parsed simply:
| Value | Description |
|---|---|
|
three milliseconds |
|
ten seconds |
|
nine minutes |
|
one hour |
|
one minute and three milliseconds |
For example,
| Value | Description |
|---|---|
|
consume 1h of time on Valentine’s Day 2022 |
|
consume from 2 days ago to 1 day ago |
|
consume from 1m ago until now |
Flags
| Value | Type | Description |
|---|---|---|
|
int |
Minimum number of batches to consume per partition. |
|
string |
Output format ( |
|
bool |
Print all sections. |
|
bool |
Print the detailed partitions batch rate section. |
|
bool |
Print the detailed partitions batch size section. |
|
bool |
Print the summary section. |
|
bool |
Print the topics section. |
|
bool |
Parse arguments as regex; analyze any topic that matches any input topic expression. |
|
string |
Time range to consume from (-24h:end, -48h:-24h, 2022-02-14:1h). |
|
duration |
Maximum duration for the command to run before timing out. |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |