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

vcsim: add TaskHistoryCollector support #3389

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Conversation

dougm
Copy link
Member

@dougm dougm commented Mar 18, 2024

refactor portions of 'EventHistoryCollector' to 'HistoryCollector' for use with 'TaskHistoryCollector'

TaskHistoryCollector provides a way to collect Task history beyond the 10 minute max of the 'RecentTask' property.
And unlike 'RecentTask', can filter based on Task state and collect tasks of child entities.

govc: add history flags to 'tasks' command

Closes #2567

@dougm dougm force-pushed the vcsim-task-history branch 4 times, most recently from 0b50b63 to 3eb9981 Compare March 18, 2024 23:35
@dougm dougm assigned akutz and unassigned akutz Mar 18, 2024
@dougm dougm requested a review from akutz March 18, 2024 23:36
@dougm dougm force-pushed the vcsim-task-history branch 3 times, most recently from e63976a to cfe7f17 Compare March 28, 2024 17:58
Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

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

Thanks @dougm !

@@ -43,29 +46,96 @@ func (m *TaskManager) init(r *Registry) {
m.Description = esx.Description
}
}

if m.MaxCollector == 0 {
m.MaxCollector = 1000
Copy link
Member

Choose a reason for hiding this comment

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

We should probably make this a well-documented constant.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a var maxCollectors. Looks like VC's default is 32 and can be changed w/ OptionManager, but don't have a use-case to support that yet.

Copy link
Member

Choose a reason for hiding this comment

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

Should it be a constant that we can adjust as needed? Is there any reason it should be a variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we end up with a use-case to support changing the max via OptionManager, then we'd need a variable. But I just clumped it into the existing set of non-exported var (...), do we gain anything by making it a constant?

TaskHistoryCollector provides a way to collect Task history beyond the 10 minute max of the 'RecentTask' property.
And unlike 'RecentTask', can filter based on Task state and collect tasks of child entities.

refactor portions of 'EventHistoryCollector' to 'HistoryCollector' for use with 'TaskHistoryCollector'

govc: add history flags to 'tasks' command

Closes vmware#2567
@dougm dougm force-pushed the vcsim-task-history branch from cfe7f17 to 4cec059 Compare April 1, 2024 18:47
Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

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

lgtm, thanks! I left one more comment about var versus constant, but I do not feel strongly about it. Thanks again @dougm !

@dougm dougm merged commit 5d7fc0e into vmware:main Apr 1, 2024
10 checks passed
@dougm dougm deleted the vcsim-task-history branch April 1, 2024 20:23
@dougm
Copy link
Member Author

dougm commented Apr 1, 2024

Thanks @akutz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add task manager to vcsim
3 participants