debugging apps & analysing usage

Post on 20-May-2015

463 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

www.xpand-it.com Proprietary & Confidential

Debugging Apps and Analysing Usage

with Visual Studio 2013

Visual Studio 2013 Airlift

05-12-2013

jorge.borralho@xpand-it.com

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

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

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

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

Return value inspection

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

Demo

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

Asynchronous debugging

• Simplified infraestructure code in call stack

• Visualize tasks

VS 2012

VS 2013

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

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

Code map

• Enhanced Call Stack

Demo

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”

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

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”

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

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

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

MMA & Intelitrace Debugging

• Exception Data

Get all exceptions recorded – and debug them

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

MMA & Intelitrace Debugging

• Analysing Sharepoint unhandled exception (1/3)

Get the Correlation Id

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

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

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)

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

Dump file analysis

• Analyse them directly in visual studio

Demo

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.

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

Energy Consumption (2/3)

• What’s measured?

• Mark profiling data

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

Energy Consumption (3/3)

• Configure device and collect data

• Profile data

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

Q & A

jorge.borralho@xpand-it.com

top related