debugging apps & analysing usage

23
www.xpand-it.com Proprietary & Confidential Debugging Apps and Analysing Usage with Visual Studio 2013 Visual Studio 2013 Airlift 05-12-2013 [email protected]

Upload: xpand-it

Post on 20-May-2015

457 views

Category:

Technology


0 download

DESCRIPTION

Debugging Apps & Analysing Usage - Jorge Borralho, Project Manager, Xpand IT Xpand IT presentation during the Visual Studio 2013 - Live Seminar

TRANSCRIPT

Page 1: Debugging Apps & Analysing Usage

www.xpand-it.com Proprietary & Confidential

Debugging Apps and Analysing Usage

with Visual Studio 2013

Visual Studio 2013 Airlift

05-12-2013

[email protected]

Page 2: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

• Jorge Borralho

• 8+ years in application development

– mainly with Microsoft products – C#, asp.net, mvc, sharepoint, sql server

who am i

Page 3: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

abstract

x64 bits edit & continue

• Debug tools

Code map

Asynchronous Debugging

Just my code (javascript)

Return value inspection

Intelitrace debugging

Microsoft Monitoring Agent

• Profiling tools

Dump file analysis

Energy consumption

Page 4: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

x64 edit & continue

• Must target 4.5.1

• Using 3rd party hosts must use IIS Express

Page 5: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Return value inspection

• Inspect functions/nested functions return values relevant to current debugging session

Demo

Page 6: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Asynchronous debugging

• Simplified infraestructure code in call stack

• Visualize tasks

VS 2012

VS 2013

Page 7: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Just my code – JS & C++

• Step through 3rd party code right to your code;

• Ignore Exceptions managed by 3rd party code.

Demo

Page 8: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Code map

• Enhanced Call Stack

Demo

Page 9: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Diagnose problems in deployment with Visual Studio and Microsoft Monitoring Agent

• Enabling MMA: – Configure witch modules to monitor

– Start monitoring (defining trace level)

– Capture Intelitrace snapshot

• Impacts app performance – Enabled to whole application pool

– Captures (almost) every object value in method-calls from defined modules

<ModuleList isExclusionList="false"> <Name>PublicKeyToken:B77A5C561934E089</Name> <Name>PublicKeyToken:B03F5F7F11D50A3A</Name> <Name>PublicKeyToken:31BF3856AD364E35</Name> <Name>PublicKeyToken:89845DCD8080CC91</Name> <Name>PublicKeyToken:71E9BCE111E9429C</Name> </ModuleList>

PS C:\>Start-WebApplicationMonitoring "IIS:\Test.Web" Monitor

"C:\IntelliTraceLogs”

Page 10: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Debugging from Intelitrace Log

– Matching source files and symbols (.pdb)

– Visual Studio 2013 ultimate

– .iTrace file

Page 11: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Review Performance Violation (1/3)

Review recorded events and choose to “dig deeper”

Page 12: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Review Performance Violation (2/3)

See multiple calls to this event, review slowest ones and debug them

Page 13: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Review Performance Violation (3/3)

Review call stack, recorded values, step through and access Intelitrace

Page 14: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Exception Data

Get all exceptions recorded – and debug them

Page 15: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Analysing Sharepoint unhandled exception (1/3)

Get the Correlation Id

Page 16: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Analysing Sharepoint unhandled exception (2/3)

Go to Analysis in the iTrace file and search by correlation Id

Page 17: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

MMA & Intelitrace Debugging

• Analysing Sharepoint unhandled exception (3/3)

Get full info in the exception, step into the intelitrace in that moment

Page 18: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

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)

Page 19: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Dump file analysis

• Analyse them directly in visual studio

Demo

Page 20: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

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.

Page 21: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Energy Consumption (2/3)

• What’s measured?

• Mark profiling data

Page 22: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Energy Consumption (3/3)

• Configure device and collect data

• Profile data

Page 23: Debugging Apps & Analysing Usage

2003 - 2013 © Copyright Xpand IT www.xpand-it.com

Q & A

[email protected]