-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve loadtest watch cmd #44844
improve loadtest watch cmd #44844
Conversation
65f003e
to
600bf77
Compare
tool/tctl/common/loadtest_command.go
Outdated
@@ -76,6 +81,8 @@ func (c *LoadtestCommand) Initialize(app *kingpin.Application, config *servicecf | |||
|
|||
c.watch = loadtest.Command("watch", "Monitor event stream").Hidden() | |||
c.watch.Flag("kind", "Resource kind(s) to watch, e.g. --kind=node,user,role").StringVar(&c.kind) | |||
c.watch.Flag("ops", "Operations to watch, e.g. --ops=put,del").Default("put,del").StringVar(&c.ops) | |||
c.watch.Flag("format", "Output format").Default(teleport.Text).StringVar(&c.format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an EnumVar
?
Same goes for ops
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated format
to be an EnumVar
. ops
doesn't map as nicely though since it's intended to be a comma-separated list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that what EnumsVar
is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnumsVar
allows for something like tctl loadtest watch --ops=del --ops=put
but doesn't support lists like tctl loadtest watch --ops=put,del
. The use of comma-separated list parameters is the goto way to handle flags that can take multiple values across the rest of teleport (token types, request ids, label selectors, etc). I'd rather keep it consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I had hoped it would support comma separated, as I agree that's more ergonomic.
600bf77
to
9b2c4b4
Compare
9b2c4b4
to
20d1526
Compare
20d1526
to
db8fcad
Compare
@fspmarshall See the table below for backport results.
|
Improves the usefulness of the
tctl loadtest watch
command in debugging by adding filtering by event op type, and the option to output a stream of json objects. Ex: