1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Session 07 kho tài liệu bách khoa

33 33 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 33
Dung lượng 5,55 MB

Nội dung

Advanced Windows Store Apps Development – II  Define Profiling  Create a Performance Report  Explain Diagnostic Tools for Store apps in Visual Studio 2013 © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session Each Store app developed by the user is a client app that performs in a sandboxed and responsive atmosphere In some cases, the user can identify some of the apps that perform slowly The main reasons for the app to deliver poor performance are as follows: An ineffective code that slows down the App Referring to any third-party libraries Remote services that takes more time to load Writing complex calculations that takes away too much of CPU’s time and capacity © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session Profiling and Collecting Performance Counters There are two main profiling techniques: © Aptech Ltd Sampling Instrumentation Sampling is the only option available in Windows Store app, with some limitations (some sampling options, such as setting the sampling event and timing interval, or collecting additional performance counter data does not supported for Windows Store apps) Instrumentation profiler, on the other hand, follows a more invasive approach because it injects specific tracing code at the beginning and end of the each function This tracing code enables the profiling tool to record each time the execution flow enters and exits an instrumented function Diagnosing Problems and Monitoring Applications/Session Concurrency Profiling This profiling method collects detailed information from the call stack each time while the competing threads forced to wait for access to a shared resource It also provides useful information about how an application interacts with the overall environment, enabling the user to identify performance bottlenecks, synchronization issues, and so on .NET memory profiling: This profiling method collects detailed information about memory allocation and garbage collection Tier Interaction Profiling (TIP): This This profiling profiling method method collects collects information information about about ADO.NET ADO.NET function function that that calls to a SQL Server database © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session Tracing and Logging Events  For logging, System.Diagnostics.Tracing namespace delivers types and members, which allow the user to create strongly typed events However, Windows Runtime supports only a subset of the available types  The information that specifies for each event is as follows: EventId - identifier for the event Keywords - Keywords related to an event Level - Represents the level of the event LogAlways - Used by the listener Critical - Represents a critical error Error - Represents a standard error Warning - Represents a warning event Informational - Provide additional information on events Verbose - Adds lengthy events or messages Message - Message for the event Opcode - Represents the operation code for the event Task - Represents the task for the event TypeId - Represents unique identifier for this attribute Version - Represents the version of the event © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session As a developer of Store apps, the user must be aware of the errors and failures such as app hanging, crashing, service unavailability, and many more conditions Therefore, the best way is to develop an app with minimum errors and bugs, so that finally the end users not have to suffer and shift to other similar competing apps Windows Store apps has many ways to monitor such pitfalls These are as follows: Using Windows Store Reports to Improve the Quality of App Windows Store provides reporting for the app Even a perfect app can crash any time Each exception is tracked inside the store and they are saved in the app summary as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 7 The following figure shows the Downloaded Exceptions Report © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session To view the error logs, the user has to install WinDbg software and using this software, the developer can debug the errors Once the software is installed, open the WinDbg.exe and navigate to File  Open Crash Dump as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session Now, the user has to select the downloaded cab file from the app store The figure shows the Open Crash Dump window © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 10 Step 3: Navigate to Debug menu and select Performance and Diagnostics as shown in following figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 19 Step 4: The user can view the window as shown in figure The user can select any of the available tools for testing Three options are given by Visual Studio These are CPU Sampling, Energy Consumption, XAML UI Responsiveness, HTML UI Responsiveness, JavaScript Function Timing, JavaScript Timing, and Performance © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 20 Step 5: This example will show how to process CPU Sampling To test the CPU sampling, the user has to select CPU Sampling from the Available Tools as shown in figure Click the Start button to start the testing © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 21 Step 6: Once the testing is started, the user can view the progress of the test as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 22 Step 7: As soon as the test is started, the DLLs will be loaded as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 23 Step 8: Before the completion of the test, the user can view the process as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 24 Step 9: After completion of the selected test, the result or the report is displayed as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 25 Step 10: To export the report, the user should click the Export Report Data from the Report tab as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 26 Step 11: While exporting the report, the user can select the details that are to be exported in the report by marking or checking various options as shown in figure The options are Caller, Call Tree, Functions, Header, and so on © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 27 Step 12: The exported reports in Excel format are saved in the project folder as shown in figure © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 28 Microsoft Visual Studio 2013 had added many diagnostic tools that can be very helpful for the developers during designing, developing, and testing phase The new tools are as follows: CodeLense Visual Studio Ultimate provides CodeLense that allows the user to view the information about code without leaving the editor References, unit tests, and other linking information can be viewed without leaving the editor It shows the CodeLense The popup shows the ready help at the time of entering the code or typing the code References are shown on the top of the methods © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 29 Code Maps Visual Studio Ultimate creates code maps where user can visualize and navigate within the relationships in the code Call stacks can also be viewed while debugging such apps When the user points on the link Show on Code Map as shown in figure, it shows the Code Map © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 30 Memory Analysis with Dump Files Memory issues always arise when the application is put into production after the development and testing phase Memory analysis tools within Visual Studio 2013 allow the user to check for any memory leaks, inefficient memory usage, unnecessary allocation of variables, and so on This diagnostic tool does not support Windows Store apps IntelliTrace IntelliTrace allows the user to monitor an app for any exceptions and performance events Recording these events in an IntelliTrace log is also possible Thus, the user can use this log to monitor, diagnose, and solve these problems during testing and deployment phase Unit Tests Users can now review and run unit tests before the app is actually put in production mode This helps in testing the app by providing certain inputs and checking the given output © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 31 Code Analysis Visual Studio 2013 provides a code analysis window that shows the warnings related to any issues with the written code Profile Guided Optimization Profile guided optimization allows the user to get data from the test runs of exe and dll files It shows how the app is likely to perform when deployed in production mode These are only available for native targets © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 32  Sampling is the only option available in Windows Store app, with some limitations, such as setting the sampling event and timing interval, or collecting additional performance counter data that does not support Windows Store apps  An instrumentation profiler follows a more invasive approach because it injects specific tracing code at the beginning and end of each function  Each event is marked with an EventAttribute attribute that enables the user to specify additional event information used by the event listener to filter the event to be traced  In Windows Store app, each exception is tracked inside the store and they are saved in the app summary  Memory will increase in size whenever more resource files are used such as images, style sheets, scripts, third party DLLs, and other resources © Aptech Ltd Diagnosing Problems and Monitoring Applications/Session 33 ... Problems and Monitoring Applications /Session 7 The following figure shows the Downloaded Exceptions Report © Aptech Ltd Diagnosing Problems and Monitoring Applications /Session To view the error logs,... Applications /Session Now, the user has to select the downloaded cab file from the app store The figure shows the Open Crash Dump window © Aptech Ltd Diagnosing Problems and Monitoring Applications /Session. .. Problems and Monitoring Applications /Session 13 The following figure shows the Sample Profiling Report © Aptech Ltd Diagnosing Problems and Monitoring Applications /Session 14 Profiling Memory Usage

Ngày đăng: 08/11/2019, 18:01

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN