Databases Reference
In-Depth Information
Enabling debug mode and running the page would produce the output as shown in Figure 6-23.
Figure 6-23, Using LOG_MESSAGE to emit a line into the debug information
However to ad real value it behooves you to mark not only the beginning, but also the end of each
significant step as in Listing 6-2.
Listing 6-2. Marking the Beginning and End of a Block of Code
BEGIN
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>'START - INSERTING 10000 RECORDS...');
--
FOR I IN 1..10000 LOOP
INSERT INTO PERF TEST (guid1, guid2, guid3, created on)
VALUES (SYS GUID, SYS GUID, SYS GUID, SYSDATE);
END LOOP;
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>END - INSERTING 10000 RECORDS...');
--
END;
Remember that execution timing is measured from the beginning of the current step to the
beginning of the subsequent step. These step boundaries coincide with the point at which a debug
message is logged. Therefore surrounding a code block with calls to LOG_MESSAGE provides the extra
benefit of capturing an accurate timing of all the code that ran between those two messages, as shown in
Figure 6-24.
Figure 6-24. Surrounding code blocks with LOG_MESSAGE calls to capture an accurate timing
Search WWH ::




Custom Search