Skip to content
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

Enhance task-queue describe #399

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Enhance task-queue describe #399

merged 3 commits into from
Dec 12, 2023

Conversation

dnr
Copy link
Member

@dnr dnr commented Dec 9, 2023

What was changed

  • temporal task-queue describe prints the TaskQueueStatus parts of the DescribeTaskQueue response
  • It now takes a --partitions flag to query for multiple partitions.

Partition fan-out is more properly done server-side, but that'll take longer and in the meantime (and on older server versions) this is still useful.

Why?

More useful for debugging.

Checklist

  1. Closes

  2. How was this tested:
    Manually

  3. Any docs updates needed?

@dnr dnr requested a review from josh-berry December 9, 2023 04:50
@@ -135,6 +135,7 @@ const (
// Task Queue flags
FlagTaskQueueName = "Name of the Task Queue."
FlagTaskQueueTypeDefinition = "Task Queue type [workflow|activity]"
FlagPartitionsDefinition = "Query for all partitions up to this number"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this may be removed in the future when implemented server-side, can we mark this flag as experimental and add a note?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely

return output.PrintItems(c, items, opts)

opts = &output.PrintOptions{
Fields: []string{"Partition", "PollerInfo.Identity", "PollerInfo.LastAccessTime", "PollerInfo.RatePerSecond", "VersionCaps.BuildId", "VersionCaps.UseVersioning"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we spell Capabilities out or use a different field name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use WorkerVersionCapabilities but that would shadow the field in PollerInfo. How about Versioning?

note that the first part of the field name is not displayed in table view, so it's mostly not visible. it is in card view or as the input to --fields

Comment on lines 46 to 47
// copy this out to display nicer in table or card, but not json
VersionCaps *commonpb.WorkerVersionCapabilities `json:"-"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still printed in the JSON view, just not flattened?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's in pollerinfo. but the table+card output functions can't handle doubly-nested fields so I had to pull it out. but json can of course (if I handle it separately)

Copy link
Member Author

@dnr dnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, this is admittedly a bit of a hack: the output library is not meant to be used twice in one invocation, it won't work well with a pager. but there are already a bunch of pager-related bugs, and we'll probably rewrite this all soon. I just didn't want to throw away the code I used for debugging.

@@ -135,6 +135,7 @@ const (
// Task Queue flags
FlagTaskQueueName = "Name of the Task Queue."
FlagTaskQueueTypeDefinition = "Task Queue type [workflow|activity]"
FlagPartitionsDefinition = "Query for all partitions up to this number"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely

Comment on lines 46 to 47
// copy this out to display nicer in table or card, but not json
VersionCaps *commonpb.WorkerVersionCapabilities `json:"-"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's in pollerinfo. but the table+card output functions can't handle doubly-nested fields so I had to pull it out. but json can of course (if I handle it separately)

return output.PrintItems(c, items, opts)

opts = &output.PrintOptions{
Fields: []string{"Partition", "PollerInfo.Identity", "PollerInfo.LastAccessTime", "PollerInfo.RatePerSecond", "VersionCaps.BuildId", "VersionCaps.UseVersioning"},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use WorkerVersionCapabilities but that would shadow the field in PollerInfo. How about Versioning?

note that the first part of the field name is not displayed in table view, so it's mostly not visible. it is in card view or as the input to --fields

@dnr dnr merged commit 54bb4b3 into temporalio:main Dec 12, 2023
17 checks passed
@cretz cretz mentioned this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants