-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Collecting some build data for tasks/targets telemetry #11359
base: main
Are you sure you want to change the base?
Conversation
…/dotnet/msbuild into proto/task-telemetry-data-plan-b
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.
Copilot reviewed 19 out of 34 changed files in this pull request and generated 5 comments.
Files not reviewed (15)
- src/Build/Microsoft.Build.csproj: Language not supported
- src/Build.UnitTests/BackEnd/NodePackets_Tests.cs: Evaluated as low risk
- src/Build/BackEnd/Components/BuildComponentFactoryCollection.cs: Evaluated as low risk
- src/Build/Definition/Toolset.cs: Evaluated as low risk
- src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs: Evaluated as low risk
- src/Build/BackEnd/Components/Logging/CentralForwardingLogger.cs: Evaluated as low risk
- src/Build/BackEnd/Components/RequestBuilder/TargetBuilder.cs: Evaluated as low risk
- src/Build/BackEnd/Components/IBuildComponentHost.cs: Evaluated as low risk
- src/Framework.UnitTests/FileClassifier_Tests.cs: Evaluated as low risk
- src/Build/BackEnd/BuildManager/BuildParameters.cs: Evaluated as low risk
- src/Build/BackEnd/Components/BuildRequestEngine/BuildRequestEngine.cs: Evaluated as low risk
- src/Build/BackEnd/Shared/TargetResult.cs: Evaluated as low risk
- src/Build/BackEnd/Components/Logging/EventSourceSink.cs: Evaluated as low risk
- src/Build/Instance/TaskFactoryWrapper.cs: Evaluated as low risk
- src/Build/BackEnd/BuildManager/BuildManager.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)
src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs:1263
- The new telemetry collection logic in 'UpdateStatisticsPostBuild' is not covered by tests. Add test cases to ensure this logic is tested.
private void UpdateStatisticsPostBuild()
src/Build/Instance/TaskRegistry.cs:1182
- The 'Stats' class should be instantiated with 'new Stats()' instead of 'new Stats'.
internal class Stats()
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.
On the first round of review it looks good! I'll look more into this
Fixes #10946
If split into separate PRs is prefered - please indicate so in comments
Goal
Obtaining information about build composition from microsoft versus 3rd party tasks and targets.
Approach
Since the information is present in the building worker nodes - the code collects it there and then (if requested) send it via
WorkerNodeTelemetryEventArgs
to the main node.The classification of 3rd party versus 1st party is for simplicity being done based on location of defining msbuild project and naming of the assembly.
Changes
Performance considerations
By default the data collection logic is off and hence statistics are not collected on worker node, nor serialized to the event args. The perf impact of collection and serialization was though beyond the recognition level of basic 'full duration' testing of full and incremental build of small console and bigger size projects.
Sample of collected data
This is stringified flushed version of stats collected and aggregated from nodes.
Once inputing into our telemetry client, we might send just subset (topN).
We collect the info about whether the task/target is 1st or 3rd party ('C:' prefix), whether it's comming from nuget cache ('N:' prefix) or is generated within metaproj, the task/target name (will be hashed for 3rd party), the duration of the task, the memory consumption of the task and the number of executions of the task