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

Add 'Analytic Summary' & PerformanceRecorderEngine to Quiet Background Processes feature #2596

Merged
merged 17 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
38 changes: 38 additions & 0 deletions DevHome.sln
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProc
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.Common", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.Common\DevHome.QuietBackgroundProcesses.Common.vcxproj", "{4B370E2F-FB1D-4887-90BF-3B72517485CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.QuietBackgroundProcesses.UI", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.UI\DevHome.QuietBackgroundProcesses.UI.csproj", "{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine", "tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine.vcxproj", "{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{DCAF188B-60C3-4EDB-8049-BAA927FBCD7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleTool", "SampleTool", "{E7C94F61-D6CF-464D-8D50-210488AF7A50}"
Expand Down Expand Up @@ -516,6 +520,22 @@ Global
{4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x64.Build.0 = Release|x64
{4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x86.ActiveCfg = Release|Win32
{4B370E2F-FB1D-4887-90BF-3B72517485CE}.Release|x86.Build.0 = Release|Win32
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|Any CPU.ActiveCfg = Debug|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|Any CPU.Build.0 = Debug|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|arm64.ActiveCfg = Debug|arm64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|arm64.Build.0 = Debug|arm64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x64.ActiveCfg = Debug|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x64.Build.0 = Debug|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x86.ActiveCfg = Debug|x86
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Debug|x86.Build.0 = Debug|x86
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|Any CPU.ActiveCfg = Release|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|Any CPU.Build.0 = Release|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|arm64.ActiveCfg = Release|arm64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|arm64.Build.0 = Release|arm64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x64.ActiveCfg = Release|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x64.Build.0 = Release|x64
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x86.ActiveCfg = Release|x86
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE}.Release|x86.Build.0 = Release|x86
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug|Any CPU.ActiveCfg = Debug|x64
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug|Any CPU.Build.0 = Debug|x64
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0}.Debug|arm64.ActiveCfg = Debug|ARM64
Expand Down Expand Up @@ -740,6 +760,22 @@ Global
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x64.Build.0 = Release|x64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x86.ActiveCfg = Release|x86
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x86.Build.0 = Release|x86
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|Any CPU.ActiveCfg = Debug|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|Any CPU.Build.0 = Debug|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|arm64.ActiveCfg = Debug|ARM64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|arm64.Build.0 = Debug|ARM64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x64.ActiveCfg = Debug|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x64.Build.0 = Debug|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x86.ActiveCfg = Debug|Win32
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Debug|x86.Build.0 = Debug|Win32
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|Any CPU.ActiveCfg = Release|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|Any CPU.Build.0 = Release|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|arm64.ActiveCfg = Release|ARM64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|arm64.Build.0 = Release|ARM64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x64.ActiveCfg = Release|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x64.Build.0 = Release|x64
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x86.ActiveCfg = Release|Win32
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -767,6 +803,8 @@ Global
{092AC740-DA01-4872-8E93-B9557DAD6BE5} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{80805B43-CE75-4C6E-92F8-F385C1039E53} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{4B370E2F-FB1D-4887-90BF-3B72517485CE} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{1477F3EA-A9F6-4B4F-82F4-C2427F57EBEE} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{AF5A7FA0-E3E8-44C8-8830-31DD08F583E8} = {D04CD3A1-0B45-4CB3-925F-204F5F6AE2D8}
{E7C94F61-D6CF-464D-8D50-210488AF7A50} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{8FC9A04E-1FFD-42BA-B304-D1FA964D99CE} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{CFD8A90D-8B6D-4ED6-BA35-FF894BEB46C0} = {8FC9A04E-1FFD-42BA-B304-D1FA964D99CE}
Expand Down
8 changes: 4 additions & 4 deletions settings/DevHome.Settings/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@
<comment>Title text for the Environments configuration feature.</comment>
</data>
<data name="QuietBackgroundProcessesExperiment_Name" xml:space="preserve">
<value>Quiet background processes experiment</value>
<comment>Name of experimental feature ()'Quiet Background Processes') on the 'Settings -> Experiments' page where you enable it.</comment>
<value>Quiet background processes</value>
<comment>Name of experimental feature 'Quiet background processes' on the 'Settings -> Experiments' page where you enable it.</comment>
</data>
<data name="QuietBackgroundProcessesExperiment_Description" xml:space="preserve">
<value>Silence and track background processes that may hinder device performance</value>
<comment>Inline description of the Quiet Background Processes experimental feature on the 'Settings -> Experiments' page where you enable it.</comment>
<value>Quiet background processes allows you to free up resources while developing</value>
dhoehna marked this conversation as resolved.
Show resolved Hide resolved
<comment>Inline description of the Quiet background processes experimental feature on the 'Settings -> Experiments' page where you enable it.</comment>
</data>
<data name="EnvironmentsCreationFlow_Description" xml:space="preserve">
<value>Create a local or cloud machine from Dev Home</value>
Expand Down
5 changes: 4 additions & 1 deletion src/DevHome.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>

<!-- Quiet Background Processes bins -->
<!-- Quiet background processes bins -->
<PropertyGroup>
<_DevHomeInternal_CppPlatform>$(Platform)</_DevHomeInternal_CppPlatform>
<_DevHomeInternal_CppPlatform Condition="'$(Platform)' == 'x86'">Win32</_DevHomeInternal_CppPlatform>
Expand All @@ -138,6 +138,9 @@
<Content Include="$(CppBaseOutDir)\DevHome.QuietBackgroundProcesses.Common\DevHome.QuietBackgroundProcesses.winmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="$(CppBaseOutDir)\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/NavConfig.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@
"buildTypeOverrides": [
{
"buildType": "dev",
"enabledByDefault": false,
"enabledByDefault": true,
"visible": true
},
{
"buildType": "canary",
"enabledByDefault": false,
"visible": false
"enabledByDefault": true,
"visible": true
},
{
"buildType": "stable",
"enabledByDefault": false,
"visible": false
"visible": true
}
]
},
Expand Down
1 change: 1 addition & 0 deletions src/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Path>DevHome.QuietBackgroundProcesses.ElevatedServer.exe</Path>
<Instancing>singleInstance</Instancing>
<ActivatableClass ActivatableClassId="DevHome.QuietBackgroundProcesses.QuietBackgroundProcessesSession" />
<ActivatableClass ActivatableClassId="DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine" />
</OutOfProcessServer>
</Extension>
</Extensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

<ItemGroup>
<ProjectReference Include="..\..\..\common\DevHome.Common.csproj" />
<ProjectReference Include="..\..\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.UI\DevHome.QuietBackgroundProcesses.UI.csproj" />
<ProjectReference Include="..\..\SetupFlow\DevHome.SetupFlow.Common\DevHome.SetupFlow.Common.csproj" />
<ProjectReference Include="..\..\SetupFlow\DevHome.SetupFlow\DevHome.SetupFlow.csproj" />
<ProjectReference Include="..\..\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -40,7 +40,6 @@
<None Remove="Views\DevDriveInsightsView.xaml" />
<None Remove="Views\MainPage.xaml" />
<None Remove="Views\MainPageView.xaml" />
<None Remove="Views\QuietBackgroundProcessesPage.xaml" />
</ItemGroup>

<ItemGroup>
Expand All @@ -60,9 +59,6 @@
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="Views\QuietBackgroundProcessesPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using DevHome.Customization.ViewModels;
using DevHome.Customization.ViewModels.DevDriveInsights;
using DevHome.Customization.Views;
using DevHome.QuietBackgroundProcesses.UI.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

Expand All @@ -19,7 +20,9 @@ public static IServiceCollection AddWindowsCustomization(this IServiceCollection
services.AddSingleton<FileExplorerViewModel>();
services.AddTransient<FileExplorerPage>();

services.AddSingleton<OptimizeDevDriveDialogViewModelFactory>(sp => (cacheLocation, environmentVariable, exampleDevDriveLocation, existingDevDriveLetters) => ActivatorUtilities.CreateInstance<OptimizeDevDriveDialogViewModel>(sp, cacheLocation, environmentVariable, exampleDevDriveLocation, existingDevDriveLetters));
services.AddSingleton<OptimizeDevDriveDialogViewModelFactory>(sp =>
(cacheLocation, environmentVariable, exampleDevDriveLocation, existingDevDriveLetters) =>
ActivatorUtilities.CreateInstance<OptimizeDevDriveDialogViewModel>(sp, cacheLocation, environmentVariable, exampleDevDriveLocation, existingDevDriveLetters));
services.AddSingleton<DevDriveInsightsViewModel>();
services.AddTransient<DevDriveInsightsPage>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,56 +249,4 @@
<value>Windows developer settings</value>
<comment>The header for the Windows developer settings card</comment>
</data>

<!-- Quiet Background Processes -->
<data name="QuietBackgroundProcesses_QuietButton_Start" xml:space="preserve">
<value>Start session</value>
<comment>Button that starts a quiet background session</comment>
</data>
<data name="QuietBackgroundProcesses_QuietButton_Stop" xml:space="preserve">
<value>Stop session</value>
<comment>Button that stops a quiet background session</comment>
</data>
<data name="QuietBackgroundProcesses.Description" xml:space="preserve">
<value>Silence and track background processes that may hinder device performance</value>
<comment>Description of the Quiet Background Processes feature</comment>
</data>
<data name="QuietBackgroundProcesses.Header" xml:space="preserve">
<value>Quiet background processes</value>
<comment>Inline title of the Quiet Background Processes feature</comment>
</data>
<data name="QuietBackgroundProcessesExplanation.Description" xml:space="preserve">
<value>This feature can be activated for 2 hours.</value>
<comment>A description of the Quiet Background Processes time window</comment>
</data>
<data name="QuietBackgroundProcessesExplanation_LinkToDocs.Text" xml:space="preserve">
<value>Link to docs</value>
<comment>Link that launches documentation</comment>
</data>
<data name="QuietBackgroundProcessesExplanation_ProvideFeedback.Text" xml:space="preserve">
<value>Provide feedback</value>
<comment>Link that launches feedback</comment>
</data>
<data name="QuietBackgroundProcessesExplanation_RelatedLinks.Text" xml:space="preserve">
<value>Related links</value>
<comment>Label for the doc links</comment>
</data>

<!-- Quiet Background Processes Status Messages -->
<data name="QuietBackgroundProcesses_Status_FeatureNotSupported" xml:space="preserve">
<value>Feature not supported on this version of Windows</value>
<comment>Indicates that this OS isn't new enough to support the feature</comment>
</data>
<data name="QuietBackgroundProcesses_Status_SessionError" xml:space="preserve">
<value>Session Error</value>
<comment>Something went wrong when running the session</comment>
</data>
<data name="QuietBackgroundProcesses_Status_SessionEnded" xml:space="preserve">
<value>Session ended</value>
<comment>The quiet session was cancelled or the time expired</comment>
</data>
<data name="QuietBackgroundProcesses_Status_UnableToCancelSession" xml:space="preserve">
<value>Unable to cancel session</value>
<comment>Something went wrong when cancelling the session</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:views="using:DevHome.Customization.Views"
xmlns:quietviews="using:DevHome.QuietBackgroundProcesses.UI.Views"
Loaded="UserControl_Loaded">
<UserControl.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
Expand Down Expand Up @@ -39,7 +40,7 @@
</controls:SettingsCard>

<!-- Quiet Background Processes -->
<views:QuietBackgroundProcessesView />
<quietviews:QuietBackgroundProcessesView />
</StackPanel>

<!-- More Windows settings -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,63 @@
// Licensed under the MIT License.

import "inspectable.idl";
import "windows.foundation.idl";

namespace DevHome.QuietBackgroundProcesses
{
// Performance Engine types
enum ProcessCategory
{
Unknown,
User,
System,
Developer,
Background,
};

[default_interface]
runtimeclass ProcessRow
{
UInt32 Pid { get; };
String Name { get; };
String PackageFullName { get; };
String Aumid { get; };
String Path { get; };
ProcessCategory Category { get; };
Windows.Foundation.DateTime CreateTime { get; };
Windows.Foundation.DateTime ExitTime { get; };

UInt64 SampleCount { get; };
Double PercentCumulative { get; };
Double VarianceCumulative { get; };
Double Sigma4Cumulative { get; };
Double MaxPercent { get; };
UInt32 SamplesAboveThreshold { get; };

UInt64 TotalCpuTimeInMicroseconds { get; };
}

[default_interface]
runtimeclass ProcessPerformanceTable
{
ProcessRow[] Rows { get; };
dhoehna marked this conversation as resolved.
Show resolved Hide resolved
}

[default_interface]
runtimeclass PerformanceRecorderEngine
{
PerformanceRecorderEngine();
void Start(Windows.Foundation.TimeSpan periodInMs);
ProcessPerformanceTable Stop();
}

// Quiet background process types
[default_interface]
runtimeclass QuietBackgroundProcessesSession
{
static QuietBackgroundProcessesSession GetSingleton();
Int64 Start();
void Stop();
ProcessPerformanceTable Stop();
Boolean IsActive { get; };
Int64 TimeLeftInSeconds { get; };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<ItemDefinitionGroup>
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)..\DevHome.QuietBackgroundProcesses.Common\;$(ProjectDir)..\DevHome.QuietBackgroundProcesses.Common\$(GeneratedFilesDir)midl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\DevHome.QuietBackgroundProcesses.Common\;$(ProjectDir)..\DevHome.QuietBackgroundProcesses.Common\$(GeneratedFilesDir)midl;$(ProjectDir)..\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>onecore.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand All @@ -135,6 +135,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="PerformanceRecorderEngineWinrt.h" />
<ClInclude Include="TimedQuietSession.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="QuietState.h" />
Expand All @@ -145,6 +146,7 @@
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="PerformanceRecorderEngineWinrt.cpp" />
<ClCompile Include="QuietBackgroundProcessesSession.cpp" />
<ClCompile Include="QuietState.cpp" />
</ItemGroup>
Expand All @@ -158,6 +160,9 @@
<ProjectReference Include="..\DevHome.QuietBackgroundProcesses.Common\DevHome.QuietBackgroundProcesses.Common.vcxproj">
<Project>{4b370e2f-fb1d-4887-90bf-3b72517485ce}</Project>
</ProjectReference>
<ProjectReference Include="..\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine\DevHome.QuietBackgroundProcesses.PerformanceRecorderEngine.vcxproj">
<Project>{af5a7fa0-e3e8-44c8-8830-31dd08f583e8}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Loading
Loading