DEV-22: You’ve got a problem, here’s how to find it Troubleshooting and debugging your application Who’s still using MESSAGE statement? Questions to ask: who’s still using MESSAGE who uses debugger/IDE debugger? Please keep questions for after and during the demos. Peter Judge Principal Software Engineer Progress OpenEdge
Session Goals Learn how to troubleshoot situations that you might find yourself in See tools and techniques used for addressing those situations Debugger Logging infrastructure DEV-22: You’ve got a problem, here’s how to find it
Agenda Diagnosis The Debugger Other tools Bugs Memory leaks Performance The Debugger Other tools Logging framework Profiler Compiler My plan is to introduce the tools in the slides and then show their debugging / troubleshooting abilities in the demo. DEV-22: You’ve got a problem, here’s how to find it
Diagnosis Your application … Queries and reports take a long time You know you’ve got problems when … Your application … Doesn’t do what it’s supposed to Does things it shouldn’t Runs slower and slower over time Queries and reports take a long time Good performance with thick client, not with thin client Performance gets worse with more users DEV-22: You’ve got a problem, here’s how to find it
Diagnosis Bugs Inefficient resource usage Performance Scalability Know your enemy Bugs Incomplete, incorrect code Inefficient resource usage Memory leaks Performance Query optimization Roundtrip optimization Network traffic Scalability Progress requires you to clean up after yourself, to avoid memory leaks. We’re not going to be able to look into all of these, especially scalability. Just mentioning here that it’s something to be aware of. Each of the tools we’ll look at will help you resolve one or more of these problems. DEV-22: You’ve got a problem, here’s how to find it
Agenda Diagnosis The Debugger Other tools Bugs Memory leaks Performance The Debugger Other tools Logging framework Compiler My plan is to introduce the tools in the slides and then show their debugging / troubleshooting abilities in the demo. DEV-22: You’ve got a problem, here’s how to find it
The Debugger Java™ graphical interface Supports local and remote debugging Supported on all platforms that support Java First official release OpenEdge® 10.0A First integrated into OpenEdge Architect in 10.1A EMPHASISE the fact the the debugger runs on Linux, Unix, Windows, and always looks the same. Debugger had Tech Preview in 9.1D05. DEV-22: You’ve got a problem, here’s how to find it
Debugger NOT enabled by default Attachable debugger a potential security risk Environment AppServer™ Introduced Attachable Debugger in 10.1A - Creates a potential security risk – others attaching to your process. Analogous properties in the ubroker.properties file On AppServers, you need to enable your environment AND the AppServer, in order to step into it. Note that it says 4GL. It should be ABL, but 4GL is grandfathered in in certain places, so you’ll see it here and there, and I might also use it. DEV-22: You’ve got a problem, here’s how to find it
Debugger Variants OpenEdge Debugger Perspective GUI Debugger First release 10.1A Re-tooled in 10.1B Eclipse Debug Framework integration GUI Debugger Launched from running ABL code, or Attach to running AVM session DEV-22: You’ve got a problem, here’s how to find it
The OpenEdge Debugger Perspective Use editor actions during debugging Persists breakpoints and settings Multiple concurrent debug sessions Uses source, not compiler listings Can add missing source code Simplified inspection of complex objects “Add Missing source code” = if source not found in propath or project, can add via UI in IDE version First release 10.1A Re-tooled in 10.1B for better Eclipse integration Changes to the OpenEdge Architect Debugger for 10.1B ensure that we leverage the Eclipse Debug framework. This provides a number of benefits: Consistency with Eclipse means that internally we are writing and maintaining a lot less code and get all the benefits that are built into this debugger. Long term this provides the ability to seamlessly integrate with Progress's other divisions. The launching of a separate OpenEdge Runtime session for debugging allows debugging and editing of code to happen at the same time; non-modal debugging. The Eclipse Debug Framework provides the ability to launch multiple debug sessions at the same time. Simplifies the interface by integrating several of the 10.1A views into a set of integrated views. This also allows us to support OOABL more natively. This support will allow us to support customized debug configurations in future. This facility will enable the OpenEdge customers to setup an appropriate runtime environment (different from development environments) and to debug in that environment. DEV-22: You’ve got a problem, here’s how to find it
The GUI Debugger AppBuilder or Procedure Editor Programmatically Compile → Debug Can step into AppServer code from Client session Programmatically DEBUGGER system handle Initiate debugging in AppServer or WebSpeed™ code MESSAGE statement DEBUGGER:INITIATE(). DEBUGGER:SET-BREAK(). Can also initiate debugger via message statement when using -debugalert -debugalert DEV-22: You’ve got a problem, here’s how to find it
Demo: OE Architect Debugger DEV-22: You’ve got a problem, here’s how to find it
Agenda Diagnosis The Debugger Other tools Bugs Memory leaks Performance The Debugger Other tools Logging framework Profiler Compiler My plan is to introduce the tools in the slides and then show their debugging / troubleshooting abilities in the demo. DEV-22: You’ve got a problem, here’s how to find it
Logging Infrastructure Why log? Report standard run-time activity Log diagnostic data for troubleshooting Data written to log file Control content using log types and levels Unified log file format Log file management (size, number) Available for all ABL clients Levels control the amount of logging information for a given type and environment. Log file management also rolls over log files when they reach their size threshold Also works with AIA, WSA, … DEV-22: You’ve got a problem, here’s how to find it
Logging Set-up LOG-MANAGER handle Progress Explorer Startup parameters Run-time GUI or Character client AppServer or WebSpeed agent Progress Explorer AppServer, AIA, WebSpeed, Unified Broker, NameServer Separate broker and server logs Startup parameters GUI or Character client Doc’ed in OpenEdge® Development: Debugging and Troubleshooting and also in startup parameter guide. Appserver/Webspeed agent and broker ARE logging infrastructure logs, you may just not have know or recognised them as such. DEV-22: You’ve got a problem, here’s how to find it
Log Entry Types 4GL Interpreter 4GLTrace 4GLTrans DB.Connects DynObjects.* FileId QryInfo SAX ProEvents.* Client 4GLMessages AS.Plumbing AS.Default MsgrTrace NameServer UBroker.* WSADefault Other Components 4GL Interpreter – Pertains to any Progress executable running 4GL code including webclient, appserver, webspeed and gui client Client – Pertains only to the client and *not* appserver and webspeed Other Components – are what they are AppServer, Messenger etc These log entry types are all doc’ed in the doc set -logentrytypes DynObjects.DB,QryInfo DEV-22: You’ve got a problem, here’s how to find it
Logging Levels 0 – None 1 – Errors 2 – Basic 3 – Verbose 4 – Extended -logentrytypes DynObjects.UI:3,qryInfo DEV-22: You’ve got a problem, here’s how to find it
Log File Management Specify log file name Specify size of log file Specify number of files to keep Rolled-over log file names -clientlog myLog.log -logthreshold 536870912 Size in BYTES -numlogfiles 8 filename.######.extension Logthreshold is in BYTES Log0001 log0002 log0003 log0004 and so on – keeps only the # you tell it to keep -rw-rw-r-- pjudge 536870912 Mar30 myLog.000001.log -rw-rw-r-- pjudge 536870912 Apr 1 myLog.000002.log -rw-rw-r-- pjudge 2451 Apr 2 myLog.log DEV-22: You’ve got a problem, here’s how to find it
Log File Archaeology with LogRead Log files (can) produce a lot of data Not always easy to read LogRead is a GUI utility for log files View, manipulate, filter, sort, merge & translate Written in ABL Extensible: Add custom log handlers Not officially supported Available on PSDN On-line Help DEV-22: You’ve got a problem, here’s how to find it
What can LogRead do? Loads log files from many sources & versions Merge multiple logs Filtering of noise from logs Localization Date formats, code pages Translation of PROMSGS Sorting and searching Timestamp adjustment Timestamp adjustment Adjust for machines with incorrect time Millisecond precision (3 decimal places) Expressed as HH:MM:SS.sss Positive or negative “Fix” incorrect timezone (or GMT) Can change after log is loaded Important for merging Merging multiple logs Merge logs of different log types Based on log type’s identified date, time and message fields Timestamp adjustment to synchronise logs from different machines i.e. support for logs of n-tier deployment Translation of promsgs Can only translate messages from promsgs i.e. numbers in parentheses - (1124) Substitutes parameters from original message to new message when possible Otherwise just displays original message untranslateda User must supply source and target promsgs And correct version! Codepage conversion supplied where possible DEV-22: You’ve got a problem, here’s how to find it
Demo: Logging & LogRead DEV-22: You’ve got a problem, here’s how to find it
Other tools Pro*Spy Plus Profiler Compiler Other & 3rd party Execution logs Profiler Execution timings Compiler COMPILER … XREF option Other & 3rd party DEV-22: You’ve got a problem, here’s how to find it
Pro*Spy Plus Traces actual ABL program execution Uses SESSION:EXECUTION-LOG Logs from the RUN perspective Only trace pertinent parts Turn tracing on and off at will Results displayed in treeview Allows drill-down Shows event types, names, locations Actual execution as opposed to how you’d expect it to execute, given your reading of the code Logging from the RUN perspective means that we can only see INPUT parameters (no return values of output parameters) Can Find and Filter SESSION:EXECUTION-LOG similar to 4GLTrace Event types; ProSpy allows better navigation/traversal DEV-22: You’ve got a problem, here’s how to find it
Profiler Profile and analyze performance data Data gathered using PROFILER system handle Profiler is a GUI Tool Shows procedure, function timings Temp-table based Drill-down through execution stack Allows side-by-side comparisons Export data to external programs Unsupported; available on PSDN DEV-22: You’ve got a problem, here’s how to find it
Other tools The Compiler as diagnostic tool Network analysis INDEX-INFORMATION query attribute COMPILE … XREF statement Network analysis Packet sniffing Now with XML Application is slow, queries take a long time to run … could be inefficient index usage INDEX-INFORMATION made available by the compiler, via the qurey handle. Also mention ProInventory for diagnosis with Tech Support issues. DEV-22: You’ve got a problem, here’s how to find it
Demo: Pro*Spy, Profiler, etc Unlikely to have time for this DEV-22: You’ve got a problem, here’s how to find it
In Summary Saw different kinds of problems you might encounter Looked at various tools used to solve those problems Debugger Logging framework Profiler Pro*Spy Plus DEV-22: You’ve got a problem, here’s how to find it
For More Information, go to… PSDN Profiler http://www.psdn.com/library/entry.jspa?categoryID=41&externalID=280 Pro*Spy Plus http://www.psdn.com/library/entry.jspa?categoryID=83&externalID=388 LogRead 1.0 Tool Overview (English & Spanish) http://www.psdn.com/library/entry.jspa?categoryID=62&externalID=1841 Log Read Utility http://www.psdn.com/library/entry.jspa?categoryID=41&externalID=349 Documentation: OpenEdge Development: Debugging and Troubleshooting OpenEdge Deployment: Startup Command and Parameter Reference DEV-22: You’ve got a problem, here’s how to find it
Questions? DEV-22: You’ve got a problem, here’s how to find it
Thank you for your time DEV-22: You’ve got a problem, here’s how to find it
DEV-22: You’ve got a problem, here’s how to find it