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

Collecting some build data for tasks/targets telemetry #11257

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

JanKrivanek
Copy link
Member

@JanKrivanek JanKrivanek commented Jan 10, 2025

[NOTE] - I'm experimenting with alternative approach - transfering the info once per build via dedicated event args

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 ProjectFinishedEventArgs (one of few event args that are being transfered regardless of connected loggers) 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

  • Added class for the exexution statistics of tasks - this is contained in TaskRegistry as well as in TaskFactoryWrappers
  • RequestBuilder is the orchestration here, that decides whether statistics are needed and if yes - traverses the TaskRegistry, BuildResult and ProjectCollection in order to accumulate and populate the statistics
  • ProjectFinishedEventArgs holds and transfers the statistics. They are only preserved during runtime - binlog de/serialization is intentionaly not added.

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.

@JanKrivanek JanKrivanek changed the title [WIP] Prototype for collecting some build data for tasks/targets telemetry Collecting some build data for tasks/targets telemetry Jan 13, 2025
@JanKrivanek JanKrivanek marked this pull request as ready for review January 13, 2025 16:40
@JanKrivanek JanKrivanek marked this pull request as draft January 14, 2025 09:59
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.

Define + implement initial metric to collect
1 participant