Presentation is loading. Please wait.

Presentation is loading. Please wait.

5/3/2019 9:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.

Similar presentations


Presentation on theme: "5/3/2019 9:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS."— Presentation transcript:

1 5/3/2019 9:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 App Diagnostics #1 The new App Diagnostics APIs
5/3/2019 9:33 PM P4169 App Diagnostics #1 The new App Diagnostics APIs Andrew Whitechapel Program Manager © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 New diagnostic APIs What are they for? How are they different?
Targeted app-profiling General-purpose tooling How are they different? Existing tools know about processes New APIs know additional UWP-specific information Can I use them now? Skeleton form in the Creators Edition Sneak-peek to the next release #MSBuild

4 Overview Introducing the new app diagnostics APIs
What’s different between Creators Edition and the next release How the API hierarchy models the kernel and platform behavior Permissions and user settings Building a UWP Task Manager

5 The new app diagnostic APIs
New APIs that provide information about running apps What apps are in memory Execution state, resource usage (memory, CPU, disk, energy) Background tasks Integrates and extends existing diagnostic APIs W.S.D.ProcessDiagnosticInfo, W.S.MemoryManager, W.AM.AppInfo W.M.D.PackageManager Enable an app to get information about any running app Permission gated by capability and settings

6 Creators Edition vs Next Release
Get a list of running apps Minimal AppDiagnosticInfo AppUserModelId, PackageFamilyName, DisplayName, Description, Logo Next Release(s) Enhanced AppDiagnosticInfo Memory usage, Execution state, Energy quota state List of background tasks List of processes Closed loop: AppDiagnosticInfo  ProcessDiagnosticInfo Change notifications

7 Creators Edition

8 Creators Edition – API usage
public ObservableCollection<RowInfo> rows = new ObservableCollection<RowInfo>(); private async void getData_Click(object sender, RoutedEventArgs e) { rows.Clear(); IList<AppDiagnosticInfo> apps = await AppDiagnosticInfo.RequestInfoAsync(); foreach (AppDiagnosticInfo app in apps) RowInfo row = new RowInfo() Logo = await GetLogoAsync(app), DisplayName = app.AppInfo.DisplayInfo.DisplayName, AppUserModelId = app.AppInfo.AppUserModelId }; rows.Add(row); } appListView.ItemsSource = rows;

9 Manifest capabilities
<Package xmlns:rescap=" windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap"> <!----> <Capabilities> <rescap:Capability Name="appDiagnostics" /> <rescap:Capability Name="packageQuery" /> </Capabilities> </Package>

10 Permissions and user settings

11 How the APIs model platform behavior

12 New and updated APIs

13 vNext – API usage DiagnosticPermission permission =
await AppDiagnosticInfo.RequestPermissionAsync(); if (permission == DiagnosticPermission.Allowed) { IList<AppDiagnosticInfo> appDiagnostics = await AppDiagnosticInfo.RequestInfoAsync(); foreach(AppDiagnosticInfo appDiagnostic in appDiagnostics) IList<ResourceGroupInfo> groups = appDiagnostic.GetResourceGroups(); foreach (ResourceGroupInfo group in groups) MemoryReport memoryReport = group.GetMemoryReport(); Debug.WriteLine( "level={0}, limit={1}, private commit={2}, total commit={3}", memoryReport.CommitUsageLevel, memoryReport.CommitUsageLimit, memoryReport.PrivateCommitUsage, memoryReport.TotalCommitUsage); }

14 Building UWP Task Manager
Add manifest capability Request permission to get info for apps Get a list of running processes either: a list of ProcessDiagnosticInfo or: a list of AppDiagnosticInfo For each process, get process-specific info For each packaged app, get app-specific info Poll for updates

15 Demo – UWP TaskManager Andrew Whitechapel 5/3/2019 9:33 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 Conclusions New APIs to get diagnostic information for running apps
Protected by capability, user consent, settings Process data and app data General-purpose diagnostic tools Targeted app profiling

17 Call to action Let attendees know what do to following this session.
5/3/2019 9:33 PM Call to action Let attendees know what do to following this session. Tell Attendees the URL where they can find your Github Code Use this slide to list resources, white papers, videos and links. Re-visit Build session recordings on Channel 9. Continue your education at Microsoft Virtual Academy online. #MSBuild © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 5/3/2019 9:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "5/3/2019 9:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS."

Similar presentations


Ads by Google