More Related Content Similar to Debugging Apps & Analysing Usage (20) Debugging Apps & Analysing Usage1. Debugging Apps and Analysing Usage
with Visual Studio 2013
Visual Studio 2013 Airlift
05-12-2013
jorge.borralho@xpand-it.com
www.xpand-it.com
Proprietary & Confidential
2. who am i
• Jorge Borralho
• 8+ years in application development
– mainly with Microsoft products – C#, asp.net, mvc, sharepoint,
sql server
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
3. abstract
• Debug tools
x64 bits edit &
continue
Return value
inspection
Asynchronous
Debugging
Just my code
(javascript)
Intelitrace
debugging
Dump file
analysis
Energy
consumption
Code map
• Profiling tools
Microsoft
Monitoring Agent
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
4. x64 edit & continue
• Must target 4.5.1
• Using 3rd party hosts must use IIS Express
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
5. Return value inspection
• Inspect functions/nested functions return values relevant
to current debugging session
Demo
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
7. Just my code – JS & C++
• Step through 3rd party code right to your code;
• Ignore Exceptions managed by 3rd party code.
Demo
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
9. MMA & Intelitrace Debugging
• Diagnose problems in deployment with Visual Studio and
Microsoft Monitoring Agent
• Enabling MMA:
–
–
–
•
Impacts app performance
–
–
2003 - 2013
<ModuleList isExclusionList="false">
<Name>PublicKeyToken:B77A5C561934E089</Name>
Configure witch modules to monitor
<Name>PublicKeyToken:B03F5F7F11D50A3A</Name>
Start monitoring (defining trace level) PS C:>Start-WebApplicationMonitoring "IIS:Test.Web" Monitor
<Name>PublicKeyToken:31BF3856AD364E35</Name>
"C:IntelliTraceLogs”
<Name>PublicKeyToken:89845DCD8080CC91</Name>
Capture Intelitrace snapshot
<Name>PublicKeyToken:71E9BCE111E9429C</Name>
</ModuleList>
Enabled to whole application pool
Captures (almost) every object value in method-calls from defined modules
© Copyright Xpand IT
www.xpand-it.com
10. MMA & Intelitrace Debugging
• Debugging from Intelitrace Log
– Matching source files and symbols (.pdb)
– Visual Studio 2013 ultimate
– .iTrace file
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
11. MMA & Intelitrace Debugging
• Review Performance Violation (1/3)
Review recorded events and choose to “dig deeper”
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
12. MMA & Intelitrace Debugging
• Review Performance Violation (2/3)
See multiple calls to this event, review slowest ones and debug them
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
13. MMA & Intelitrace Debugging
• Review Performance Violation (3/3)
Review call stack, recorded values, step through and access Intelitrace
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
14. MMA & Intelitrace Debugging
• Exception Data
Get all exceptions recorded – and debug them
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
15. MMA & Intelitrace Debugging
• Analysing Sharepoint unhandled exception (1/3)
Get the Correlation Id
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
16. MMA & Intelitrace Debugging
• Analysing Sharepoint unhandled exception (2/3)
Go to Analysis in the iTrace file and search by correlation Id
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
17. MMA & Intelitrace Debugging
• Analysing Sharepoint unhandled exception (3/3)
Get full info in the exception, step into the intelitrace in that moment
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
18. Dump file analysis
• When a long running app starts behaving sluggishly or
crashes with OutOfMemoryException, or even the whole
server/system slows down
– Probably bad memory usage:
• Memory leaks
• Unnecessary allocation
• Inefficient memory use
• Better analyze the memory dump
– using task manager, procdump (sysinternals) or even VS 2013
(capturing a breakpoint)
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
19. Dump file analysis
• Analyse them directly in visual studio
Demo
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com
20. Energy Consumption (1/3)
• The Visual Studio Energy Consumption profiler helps
you analyze the power and energy consumption of
Windows Store apps on low-power tablet devices that run
all or part of the time on their own batteries. On a
battery-powered device, an app that uses too much
energy can cause so much customer dissatisfaction that,
eventually, customers might even uninstall it. Optimizing
energy use can increase your app’s adoption and use by
customers.
2003 - 2013
© Copyright Xpand IT
www.xpand-it.com