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

Expose processes leveraged by BuildManager #11146

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Build/BackEnd/BuildManager/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,15 @@ void Callback(object? state)
ThreadPoolExtensions.QueueThreadPoolWorkItemWithCulture(Callback, parentThreadCulture, parentThreadUICulture);
}

/// <summary>
/// Point in time snapshot of all worker processes leveraged by this BuildManager.
/// This is meant to be used by VS. External users should not this is only best-effort, point-in-time functionality
/// without guarantee of 100% correctness and safety.
/// </summary>
/// <returns>Enumeration of <see cref="Process"/> objects that were valid during the time of call to this function.</returns>
public IEnumerable<Process> GetWorkerProcesses()
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 consider leveraging telemetry for this information too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Once we have it, we surely can :-)

What exact telemetry would you like to collect?

=> (_nodeManager?.GetProcesses() ?? []).Concat(_taskHostNodeManager?.GetProcesses() ?? []);

/// <summary>
/// Clears out all of the cached information.
/// </summary>
Expand Down