Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

TraceOpen – PB Docs 150 – PowerBuilder Library

TraceOpen – PB Docs 150

TraceOpen PowerScript function

Description

Opens a trace file with the specified name and enables logging
of application trace activities.

Syntax

Argument

Description

filename

A read-only string used to identify the
trace file

timer

A value of the enumerated datatype TimerKind
that identifies the timer. Values are:

  • Clock! – Use the clock timer

  • Process! – Use the process timer

  • Thread! – Use the thread timer

  • TimerNone! – Do not log timer values

Return Values

ErrorReturn. Returns one of the following values:

  • Success! – The function
    succeeded

  • FileAlreadyOpenError! – TraceOpen has
    been called again without an intervening TraceClose

  • FileOpenError! – The file could not be
    opened for writing

  • EnterpriseOnlyFeature! – This function
    is only supported in the Enterprise edition of PowerBuilder.

If filename is null, TraceOpen returns null.

Usage

TraceOpen opens the specified trace file
and enables logging of application trace activities. When it opens
the trace file, TraceOpen logs the current application
and library list to the trace file. It also enables logging of the
default activity type, a user-defined activity type identified by
the value ActUser!.

After calling TraceOpen, you can select
any additional activities to be logged in the trace file using the TraceEnableActivity function.
Once you have called TraceOpen and TraceEnableActivity,
you must then call TraceBegin for logging to
begin.

To stop logging of application trace activity, you must call
the TraceEnd function followed by TraceClose to
close the trace file. Each call to TraceOpen resets
the logging of activity types to the default ActUser!

You typically include the TraceOpen function
in your application’s Open script.

note.png Caution

If the trace file runs out of disk space, no error is generated,
but logging is stopped, and the trace file cannot be used for analysis.

By default, the time at which each activity begins and ends
is recorded using the clock timer, which measures an absolute time
with reference to an external activity, such as the machine’s
startup time. The clock timer measures time in microseconds. Depending
on the speed of your machine’s central processing unit,
the clock timer can offer a resolution of less than one microsecond.
A timer’s resolution is the smallest unit of time the timer
can measure.

You can also use process or thread timers, which measure time
in microseconds with reference to when the process or thread being
executed started. Use the thread timer for distributed applications.
Both process and thread timers give you a more accurate measurement
of how long the process or thread is taking to execute, but both
have a lower resolution than the clock timer.

If your analysis does not require timing information, you
can omit timing information from the trace file.

Collection time

The timestamps in the trace file exclude the time taken to collect
the trace data.

Examples

This example opens a trace file with the name you
entered in a single line edit box and a timer kind selected from
a drop-down list. Then it begins logging the enabled activities
for the first block of code to be traced:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x