未验证 提交 b02e5e15 编写于 作者: S Steve Pfister 提交者: GitHub

[workloads] Add telemetry for mobile and wasm workloads (#90208)

This change adds CLI telemetry for common mobile and wasm scenarios.

Total app size is another element we plan on tracking and that will be added in a follow up.

Fixes https://github.com/dotnet/runtime/issues/88844
上级 39c0dbf5
......@@ -18,12 +18,14 @@
<WorkloadManifestPath>$(IntermediateOutputPath)WorkloadManifest.json</WorkloadManifestPath>
<WorkloadManifestTargetsPath>$(IntermediateOutputPath)WorkloadManifest.targets</WorkloadManifestTargetsPath>
<WorkloadManifestWasiTargetsPath>$(IntermediateOutputPath)WorkloadManifest.Wasi.targets</WorkloadManifestWasiTargetsPath>
<WorkloadManifestTelemetryTargetsPath>$(MSBuildThisFileDirectory)WorkloadTelemetry.targets</WorkloadManifestTelemetryTargetsPath>
</PropertyGroup>
<ItemGroup>
<PackageFile Include="$(WorkloadManifestPath)" TargetPath="data" />
<PackageFile Include="$(WorkloadManifestTargetsPath)" TargetPath="data" />
<PackageFile Include="$(WorkloadManifestWasiTargetsPath)" TargetPath="data" />
<PackageFile Include="$(WorkloadManifestTelemetryTargetsPath)" TargetPath="data" />
</ItemGroup>
<ItemGroup>
......
......@@ -204,4 +204,7 @@
BeforeTargets="Build">
<Error Text="WebAssembly workloads can only support one active threading mode at a time. Either set WasmEnableThreads or WasmEnablePerfTracing to true, but not both." />
</Target>
<Import Condition="'$(TargetsCurrent)' == 'true' and ('$(UsingBrowserRuntimeWorkload)' == 'true' or '$(UsingMobileWorkload)' == 'true')"
Project="$(MSBuildThisFileDirectory)WorkloadTelemetry.targets" />
</Project>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<Target Name="_WorkloadTelemetry"
Condition="'$(_MonoWorkloadTargetsMobile)' == 'true' and '$(TargetsCurrent)' == 'true'"
AfterTargets="Publish"
DependsOnTargets="_WorkloadGatherTelemetryData">
<ItemGroup>
<WorkloadPublishProperties Include="TargetPlatformIdentifier" Value="$(TargetPlatformIdentifier)" />
<WorkloadPublishProperties Include="RuntimeIdentifier" Value="$(RuntimeIdentifier)" />
<WorkloadPublishProperties Include="BlazorWasm" Value="$(_WorkloadUsesBlazorWasm)" />
<WorkloadPublishProperties Include="WasmSDK" Value="$(_WorkloadUsesWasmSDK)" />
<WorkloadPublishProperties Include="UsesMaui" Value="$(UseMaui)" />
<WorkloadPublishProperties Include="UsesMobileSDKOnly" Value="$(_WorkloadUsesMobileSDKOnly)" />
<WorkloadPublishProperties Include="UsesOtherMobileSDK" Value="$(_WorkloadUsesOther)" />
<WorkloadPublishProperties Include="MonoAOT" Value="$(_WorkloadUsesMonoAOT)" />
<WorkloadPublishProperties Include="NativeAOT" Value="$(_WorkloadUsesNativeAOT)" />
<WorkloadPublishProperties Include="Interp" Value="$(_WorkloadUsesInterpreter)" />
<WorkloadPublishProperties Include="LibraryMode" Value="$(_WorkloadUsesLibraryMode)" />
<WorkloadPublishProperties Include="HybridGlobalization" Value="$(HybridGlobalization)" />
<WorkloadPublishProperties Include="ResolvedRuntimePack" Value="$(_MonoWorkloadRuntimePackPackageVersion)" />
</ItemGroup>
<AllowEmptyTelemetry EventName="WorkloadPublishProperties" EventData="@(WorkloadPublishProperties)" />
</Target>
<Target Name="_WorkloadGatherTelemetryData">
<PropertyGroup>
<_WorkloadUsesBlazorWasm>$(UsingMicrosoftNETSdkBlazorWebAssembly)</_WorkloadUsesBlazorWasm>
<_WorkloadUsesWasmSDK>$(UsingMicrosoftNETSdkWebAssembly)</_WorkloadUsesWasmSDK>
<_WorkloadUsesMonoAOT>$(RunAOTCompilation)</_WorkloadUsesMonoAOT>
<_WorkloadUsesMonoAOT Condition="'$(RunAOTCompilation)' == '' and '$(PublishAot)' != 'true' and ('$(TargetPlatformIdentifier)' == 'maccatalyst' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos')">$(_RunAotCompiler)</_WorkloadUsesMonoAOT>
<_WorkloadUsesNativeAOT>$(PublishAot)</_WorkloadUsesNativeAOT>
<_WorkloadUsesInterpreter>$(MonoForceInterpreter)</_WorkloadUsesInterpreter>
<_WorkloadUsesInterpreter Condition="'$(_WorkloadUsesInterpreter)' == '' and '$(UseInterpreter)' == 'true'">true</_WorkloadUsesInterpreter>
<_WorkloadUsesInterpreter Condition="'$(_WorkloadUsesInterpreter)' == '' and '$(RunAOTCompilation)' != 'true' and ('$(_WorkloadUsesBlazorWasm)' == 'true' or '$(_WorkloadUsesWasmSDK)' == 'true')">true</_WorkloadUsesInterpreter>
<_WorkloadUsesLibraryMode Condition="'$(NativeLib)' != '' and ('$(_WorkloadUsesMonoAOT)' == 'true' or '$(_WorkloadUsesNativeAOT)' == 'true')">true</_WorkloadUsesLibraryMode>
</PropertyGroup>
<PropertyGroup>
<_WorkloadUsesOther Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'avalonia.dll'">true</_WorkloadUsesOther>
<_WorkloadUsesOther Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'uno.dll'">true</_WorkloadUsesOther>
<_WorkloadUsesMobileSDKOnly Condition="'$(RuntimeIdentifier)' != 'browser-wasm' and '$(UseMaui)' != 'true' and '$(_WorkloadUsesOther)' != 'true'">true</_WorkloadUsesMobileSDKOnly>
</PropertyGroup>
</Target>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册