sap business one: on sdn: .net profiler 2.0 – how to use it ......sap business one: on sdn: .net...

33
SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please note that we are recording this session! SAP Business One Welcomes you to the Weekly Partner Webinar Series

Upload: others

Post on 10-Mar-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

SAP Business One:On SDN: .NET Profiler 2.0 – How to use it efficiently

Frank MoebiusSolution Architect

Please note that we are recording this session!

SAP Business One Welcomes you to the Weekly Partner Webinar Series

Page 2: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 2

Your Instructor

Frank MoebiusSolution Architect

Page 3: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 3

Prerequisites

Required:

Knowledge of SAP Business One 2005

Recommended:

SAP Business One SDK Add-On development knowledge

Page 4: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 4

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 5: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 5

SDN – SAP Business One SDK Tools area

Page 6: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 6

B1TE Tools – What’s inside?

SAP Business One Test Environment (B1TE)B1 DB BrowserB1 DB ProfilerForm CheckerBubble Checker.NET Profiler

Delivered within SDN license modelfor freewithout any supportwithout any warrantywith source code

Page 7: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 7

B1 .NET Profiler 2.0 – What it does and how it works…

B1 .NET Profiler profiles:Calls to any .NET DLLs – e.g. the UI and DI calls executed by a .NET Add-On.Exceptions and possible compatibility breakages.Into a Window – or into a file

Generates list of used objects/methods for SAP ICC certification or your QA.

B1 .NET Profiler is composed of 2 parts:The B1 Profiler library which gathers all the data and sends it toThe B1 Profiler Window application using sockets

If you would like to extend the profiling functionality of .NET Profiler you would need to extend the B1 Profiler library!

Page 8: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 8

B1 .NET Profiler – Architecture / Implementation

The following picture describes the high-level architecture of this profiler, described in deeper details in B1TE documentation:

Find the „B1 Profiler library“ at …\B1TE\B1TETools\B1Profiler\B1Profiler\

In the file ProfilerCallback.cpp you can find the method dumpFunctionData that is called when a call through the .NET Profiling API comes in...

If the call should get logged the information is in the end sent to the .NET Profiler Window through:

sendMessage(currentPid, currentTid, elapsedTime, wszClass, wszMethod)

.NET CLR

YOUR .NET-based Add-On

B1 Profiler library

B1 Profiler Window

ICorProfilerICorProfilerCalinterfaces

Socket

Page 9: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 9

B1TE / .NET Profiler – Benefits / usage

• Use it for your QA• Test the code

• Support• Have customer going through a scenario and eventualy find the issue;

limitation of .NET Profiling API 1.1: no data – just function calls!

• Used for Solution Certification• SAP ICC will use .NET Profiler too when performing tests according to

the „Test Plan“

•…

Page 10: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 10

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 11: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 11

B1TE Installation

Page 12: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 12

Environment variables for .NET Profiler

You can easily set / reset them by using the Start Menu -> SAP Business One -> Test Tools -> .NET Profiler -> Start Profiling and Stop Profilingmenus.

Please note that after running StartProfiling / EndProfiling commands you will need to reboot your PC

or

open the window Control Panel -> System -> Advanced -> Environment Variables and press OK to have the correct environment set.

Page 13: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 13

.NET Profiler ready to go…

Important notes:

B1 Profiler Window is a .NET application. It needs to be started in an environment where the variable COR_ENABLE_PROFILING is set to 0 to avoid that it will profile itself...

As the .NET Profiler can profile calls done by any application run with the variable COR_ENABLE_PROFILING set to 1, you must set a filter to reduce the number of profiled calls…

Page 14: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 14

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 15: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 15

Using an existing filter…

Page 16: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 16

Defining a filter… / Adding an additional Assembly

The initially selected classes are the ones of the currently loaded filter…

• Select UI API or DI API classes / objects – or clear or set all…

• Add other .NET assemblies

Page 17: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 17

Samples for *. filter files…

Page 18: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 18

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 19: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 19

„Rules“ in .NET Profiler

The tool comes with a set of predefined rules that check against usage of deprecated API calls and some programming best practices.

Please find the list of the rules provided for releases 2004, 2005 and 2005 SP01 in the documentation (B1TE.doc).

The rules for the single versions are stored in the corresponding *.rules files.

Any check is represented in a single rule (e.g. 1 rule for every deprecated call).

E.g. Forms.AddEx() should be used since UI API 2004 instead of Forms.Add(). In the *.rules files this rule consists of 4 lines:

FormsClass 1) The class / object

Add 2) The method

Deprecated call: substitute with AddEx 3) The text issued in .NET Profiler

4) An empty line

Page 20: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 20

Sample / Editing a *.rules file…

Page 21: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 21

Setting a predefined rule…

Page 22: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 22

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 23: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 23

„Profile into Window“ – can be saved later…

Page 24: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 24

„Profile in a file“: CSV file – imported into MS Excel

Page 25: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 25

„Save All Logs“… - CSV in spreadsheet

Page 26: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 26

„Save Logs for TPP“… - CSV in spreadsheet

Results grouped per class / object…

Page 27: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 27

Live Demo

Lets get some logs now:

- Track performance issues

- Find out why an Add-On is not working- Add-On not ready- Exception occurs

-

Page 28: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 28

Agenda: On SDN - .NET Profiler 2.0

Installation

Filters

Rules

Logs

Interpreting results

Introduction / Architecture

Page 29: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 29

Interpretation of the log itself

Please note:

- Often you will find that multiple threads are working in your Add-On – even if you did not implement multithreading!

- The log itself will NOT help you when you don‘t know the source code in detail; in that case you may only find major issues likeexceptions not handled at the right place…

Page 30: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 30

More thoughts…

Not a surprise, but in case of performance issues it may help to:

- Filter calls which you suspect to cause the issues +

- try to find other ways to do want you want to (may not always be possible)

…BUT don‘t just watch out for the calls that consume most of the time! It may happen that there are just too many small calls which cause the trouble…

Page 31: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 31

Use data in Excel…

…there‘s an article on SDN which discusses the usage of .NET Profiler to discover performance issues:Add-Ons Performance Analysis Using .NET Profiler tool (PDF 352.5KB) + some articles with small samples on best-practices affecting performance…

Page 32: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 32

Thank you !

Additional information:http://service.sap.com/smb

http://sdn.sap.com

Page 33: SAP Business One: On SDN: .NET Profiler 2.0 – How to use it ......SAP Business One: On SDN: .NET Profiler 2.0 – How to use it efficiently Frank Moebius Solution Architect Please

© SAP AG 2006, On SDN: Articles + Tools for Add-On Development / Frank Möbius / 33

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries.Oracle is a registered trademark of Oracle Corporation.UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc.JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express prior written permission of SAP AG.This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments, and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that this document is subject to change and may be changed by SAP at any time without notice.SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence.The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages

Copyright 2006 SAP AG. All Rights Reserved