done02: where did you go wrong? diagnostics and troubleshooting in openedge kris murphy senior...
TRANSCRIPT
DONE02: Where Did You Go Wrong? Diagnostics and Troubleshooting in OpenEdge
Kris MurphySenior Solution Engineer
2 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Agenda
Diagnostic & Troubleshooting Tools Overview
Common Troubleshooting Situations– Memory Leak
– Performance Issue
– Error in AppServer™ code Planned for OpenEdge™10.1A
3 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Diagnostic & Troubleshooting Tools
GUI Debugger Logging Infrastructure LogRead Profiler Pro*Spy Plus
4 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
GUI Debugger
Modern Java™ graphical interface Initial Technology Preview 9.1D SP 05 First official release OpenEdge™ 10 Supports local and remote debugging Supported on Windows and all
versions of UNIX that support Java
5 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
For Your Application Safety…
Client – Start → Programs → OpenEdge → Proenv
AppServer™
Debugging is NOT enabled by default
6 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
GUI Debugger
AppBuilder or Procedure Editor– Compile → Debug
– Can step into AppServer code from Client session
DEFINE VARIABLE debug AS LOGICAL. debug = DEBUGGER:INITIATE().debug = DEBUGGER:SET-BREAK(“dordbug.p",6).
Programmatically– DEBUGGER system handle methods
– Initiate debugging in AppServer or WebSpeed® code
7 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Main Debugger Window
Toolbar
Right Click - Dataviews
View\Hide Panes
Organized by type
Source Code
4GL
Procedure
Stack
VariablesWatches
Menubar
8 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Source Code Pane
Shows code Breakpoints
– Set– Remove– Enable/Disable
Arrow current line of execution
9 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
4GL Procedure Stack Pane
10 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Variables Pane
Variables Parameters Buffers Temp Tables DataSets
11 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Watches Pane
Type variable directly in watches pane Keeps track of variables, buffer fields, attributes,
etc.
12 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
More Variable Detail - Dataview
Additional information Debug Dataview
13 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Quick Dataviews
DataList of SYSTEM
HANDLES
14 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Traversing NEXT-SIBLING
15 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Conditional Breakpoints
16 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Watchpoints
17 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Diagnostic & Troubleshooting Tools
GUI Debugger Logging Infrastructure LogRead Profiler Pro*Spy Plus
18 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Logging Infrastructure We had logging in Progress® V9. We just
made it better in OpenEdge 10!– Easier to get rid of “noise” in the logs– Unified format– Control Log Size – New log entry types
Logging Infrastructure– Log entry types– Logging levels– Log size threshold– LOG-MANAGER
19 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Log Entry Types
4GL Interpreter 4GLTrace DB.Connects DynObjects.* QryInfo SAX ProEvents.*
-logentrytypes DynObjects.DB,QryInfo
Client 4GLMessages
Other Components AS.Plumbing AS.Default MsgrTrace NameServer
20 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Logging Levels
0 – None 1 – Errors 2 – Basic 3 – Verbose 4 – Extended
-logginglevel 2
-logentrytypes DynObjects.UI:3,qryInfo
21 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Log File Has Size Threshold Startup Parameters
– Log Threshold
– Keep Log Files Progress Explorer
-numlogfiles
-logthreshold
22 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
LOG-MANAGER
Runtime access Setting log file name
LOG-MANAGER:LOGFILE-NAME = “Mylog.log”.
Setting logging levelLOG-MANAGER:LOGGING-LEVEL = 2.
StartingLOG-MANAGER:LOG-ENTRY-TYPES = “4GLTrace”.
StoppingLOG-MANAGER:LOGGING-LEVEL = 0.
23 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Diagnostic & Troubleshooting Tools
GUI Debugger Logging Infrastructure LogRead Profiler Pro*Spy Plus
24 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
LogRead
GUI utility to view, filter, sort, merge and translate Progress log files
Not officially supported– On-line Help
Available on PSDN
25 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Loading a Log File
Log file format Date format
Time adjustment Promsgs
translation Date Range Filter
26 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
LogRead
Log View Utilities Queries
27 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Sample
28 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Analyze the Merge
29 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
LogRead Planned Enhancement
Users can write their own:– Utilities to help analyze log files– Handlers to load other types of log files
Microsoft IIS log file
30 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Diagnostic & Troubleshooting Tools
GUI Debugger Logging Infrastructure LogRead Profiler Pro*Spy Plus
31 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Profiler
Provides profile of procedure execution Analyze where most time is spent Not officially supported Available on PSDN
32 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Profiler
33 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Profiler
34 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Diagnostic & Troubleshooting Tools
GUI Debugger Logging Infrastructure LogRead Profiler Pro*Spy Plus
35 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Pro*Spy Plus
Debugging tool used to trace the execution of a 4GL program
Can be turned on and off at the beginning or during execution
Results of tracing, which include all procedures, triggers, and functions appear in a browse widget
36 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Pro*Spy Plus – Example
37 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Pro*Spy Plus – Example
38 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Pro*Spy Plus – Example
39 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Agenda
Diagnostic & Troubleshooting Tools Overview
Common Troubleshooting Situations– Memory Leak
– Performance Issue
– Error in AppServer™ code Planned for OpenEdge 10.1A
40 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Memory Leak
Memory is allocated and never freed Application may slow down, and it may affect
the system as a whole Dynamic Objects, Memptrs Tools for diagnosing
– Logging -LogEntryType DynObjects.* LogRead
– Debugger Dynamic Object Tracker
41 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Memory Leak - LoggingLOG-MANAGER:LOGFILE-NAME = “memleak.log”.LOG-MANAGER:LOG-ENTRY-TYPES = “DynObjects.*”.LOG-MANAGER:LOGGING-LEVEL = 3.
CREATE TEMP-TABLE tth.bufHdl = BUFFER customer:HANDLE.tth:CREATE-LIKE(bufHdl).
CREATE TEMP-TABLE tth2.bufhdl2 = BUFFER order:HANDLE.tth2:CREATE-LIKE(bufhdl2).
CREATE QUERY qh.
DELETE OBJECT tth.DELETE OBJECT qh.LOG-MANAGER:LOGFILE-NAME = “”.
LOG-MANAGER:LOGFILE-NAME = “memleak.log”.LOG-MANAGER:LOG-ENTRY-TYPES = “DynObjects.*”.LOG-MANAGER:LOGGING-LEVEL = 3.
CREATE TEMP-TABLE tth.bufHdl = BUFFER customer:HANDLE.tth:CREATE-LIKE(bufHdl).
CREATE TEMP-TABLE tth2.bufhdl2 = BUFFER order:HANDLE.tth2:CREATE-LIKE(bufhdl2).
CREATE QUERY qh.
DELETE OBJECT tth.DELETE OBJECT qh.LOG-MANAGER:LOGFILE-NAME = “”.
LOG-MANAGER:LOGFILE-NAME = “memleak.log”.LOG-MANAGER:LOG-ENTRY-TYPES = “DynObjects.*”.LOG-MANAGER:LOGGING-LEVEL = 3.
CREATE TEMP-TABLE tth.bufHdl = BUFFER customer:HANDLE.tth:CREATE-LIKE(bufHdl).
CREATE TEMP-TABLE tth2.bufhdl2 = BUFFER order:HANDLE.tth2:CREATE-LIKE(bufhdl2).
CREATE QUERY qh.
DELETE OBJECT tth.DELETE OBJECT qh.LOG-MANAGER:LOGFILE-NAME = “”.
42 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Memory Leak - Logging
43 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Memory Leak - LogRead
Utilities FindDynObjLeak
44 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Memory Leak - Dynamic Object Tracking
Diagnostics
Monitor Dynamic Objects
45 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Dynamic Object Tracking
/* ttdelay.p */
CREATE TEMP-TABLE ttHdl1.
bufHdl = BUFFER customer:HANDLE.
ttHdl1:CREATE-LIKE(bufHdl).
ttHdl1:TEMP-TABLE-PREPARE("ttcust").
RUN dyn (TABLE-HANDLE ttHdl1,
OUTPUT TABLE-HANDLE ttHdl2).
…
46 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Dynamic Object Tracking/* ttdelay.p Continued*/
Procedure dyn: DEFINE INPUT PARAM TABLE-HANDLE inhdl. DEFINE OUTPUT PARAM TABLE-HANDLE outHdl. … CREATE TEMP-TABLE outHdl. … outHdl:TEMP-TABLE-
PREPARE(“ttorder”). DELETE OBJECT inhdl.
END.
47 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
If you forgot to cleanup
/* ttdelay.p Continued*/
DELETE OBJECT ttHdl1.
DELETE OBJECT ttHdl2.
RETURN.
What did we forget
to delete?
/* ttdelay.p Continued*/
Procedure dyn: DEFINE INPUT PARAM TABLE-HANDLE inhdl. DEFINE OUTPUT PARAM TABLE-HANDLE outHdl. … CREATE TEMP-TABLE outHdl. … outHdl:TEMP-TABLE-
PREPARE(“ttorder”). DELETE OBJECT inhdl. DELETE OBJECT outhdl.END.
48 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
If you forgot to cleanup
Dynamic Object tracking allows you to quickly identify your failure to delete objects
49 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Agenda
Diagnostic & Troubleshooting Tools Overview
Common Troubleshooting Situations– Memory Leak
– Performance Issue
– Error in AppServer™ code Planned for OpenEdge 10.1A
50 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance Issues in the 4GL
Application is slow, queries take a long time to run
Inefficient index usage Diagnostic Tools
– INDEX-INFORMATION Attribute
– Query-Info Logging
– Profiler
51 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance – INDEX-INFORMATION Attribute
qh:QUERY-PREPARE("FOR EACH customer WHERE name MATCHES ‘A*’”).
qh:QUERY-OPEN.
message qh:INDEX-INFORMATION(1) view-as alert-box.
qh2:QUERY-PREPARE("FOR EACH item WHERE name BEGINS ‘A’”).
qh2:QUERY-OPEN.
message qh2:INDEX-INFORMATION(1) view-as alert-box.
52 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance – Query-Info Logging
LOG-MANAGER:LOGFILE-NAME = “Query.log”.
LOG-MANAGER:LOG-ENTRY-TYPES = “QryInfo:3”.
RUN runQuery(INPUT "for each customer where name begins 'A'").
RUN runQuery(INPUT "for each customer where name matches 'A*'").
PROCEDURE runQuery:
…
hqry:QUERY-PREPARE(cQry).
hqry:QUERY-OPEN().
…
hqry:QUERY-CLOSE().
…
END.
LOG-MANAGER:LOGGING-LEVEL=0.
53 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance – Query-Info Logging – Query Plan
Query-Plan: how we extract information for the query including: – Query Type, Prepare String, Sorted, Scrolling
54 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance –Query-Info Logging Query Statistics
Query Statistics: information on the query as it extracts data from the database including: – Times prepared (Dynamic only)– Time to prepare (Dynamic only)– Database blocks accessed– Records sent from server
Useful Failed
55 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance –Query-Info Logging Query Statistics
Name BEGINS ‘A’ Name MATCHES ‘A*’
56 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Performance - Profiler
57 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Agenda
Diagnostic & Troubleshooting Tools Overview
Common Troubleshooting Situations– Memory Leak
– Performance Issue
– Error in AppServer code Planned for OpenEdge 10.1A
58 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Error in AppServer code
Attachable Debugger– Server in another office / building
– No monitor attached
– Easier to debug from where you are
59 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Attachable Debugger
Start Attachable Debugger – Start → Programs → OpenEdge → Debugger
Ready the Client process for debugging– -debugReady port-number– proDebugConfig– Attachable Debugger
60 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Attachable Debugger
61 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Break on Error Message
From within the debugger: Edit Breakpoints
62 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Attachable Debugger
63 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Agenda Diagnostic & Troubleshooting
Tools Overview Common Troubleshooting
Situations– Memory Leak
– Performance Issue
– Remote Debugging Planned for OpenEdge 10.1A
64 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
D I S C L A I M E R
Coming in OpenEdge™ 10.1A
This talk includes information about potential future products and/or product enhancements.
What I am going to say reflects our current thinking, but the information contained herein is preliminary and subject to change. Any future products we ultimately deliver may be materially different from what is described here.
D I S C L A I M E R
65 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Planned for OpenEdge 10.1A
User Logging 4GL Tracing: Log “return” from procedure Query-Info Logging Enhancements
66 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
In Summary
Diagnostic Tools Overview Common Debugging &
Troubleshooting Situations To Learn More:
– Debugging & Troubleshooting Guide
– PSDN
– On-line Help
67 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Questions?
68 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation
Thank you for your time!
69 DONE 02: Where Did You Go Wrong?© 2005 Progress Software Corporation