1. yakov werde
  2. PowerBuilder
  3. Thursday, 14 December 2017 15:59 PM UTC

Hello,

We have a rather huge legacy application with a variable set of "long running" application startup behaviors.  Differences in run depend on 1) time of day (first login for day or not), 2) run from IDE or EXE 3) program options installed.  I am tasked with providing performance statistics (timing, resource ) for all possible startup combinations. The goal will be projects to address startup latency.

I am able to enable tracing via System Options - and also in PowerScript code. I notice that the standard Profiling tools (New -->Tool) are glued to the  Trace File Name (pbp) on the system dialog.  Most important to us, the tools are 'sparsely' (Hmmph) documented / and not extensible. (no source is provided)

Is there any better doc.  Is there source.  or are there other profile tool choices available.  Or must we develop our own using the APIs provided?

Thanks

Yakov

Alfredo Aldama Accepted Answer Pending Moderation
  1. Tuesday, 27 March 2018 04:01 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

I hope this helps...

Documentation about trace and profile

Example by Appeon

https://www.appeon.com/developers/library/code-samples-for-pb

 

Where to configure? Screens where you can configure ...

 

Code of Example (on Documentation)

ErrorReturn le_err

integer li_key

TimerKind ltk_kind

 

CHOOSE CASE ddlb_timerkind.Text

   CASE "None"

      ltk_kind = TimerNone!

   CASE "Clock"

      ltk_kind = Clock!

   CASE "Process"

      ltk_kind = Process!

   CASE "Thread"

      ltk_kind = Thread!

END CHOOSE

 

// Open the trace file and return an error message

// if the open fails

le_err = TraceOpen( sle_fileName.Text, ltk_kind )

IF le_err <> Success! THEN &

   of_errmsg(le_err, 'TraceOpen failed')

   RETURN

END IF

 

// Enable trace activities. Enabling ActLine!

// enables ActRoutine! implicitly

TraceEnableActivity(ActESQL!)

TraceEnableActivity(ActUser!)

TraceEnableActivity(ActError!)

TraceEnableActivity(ActLine!)

TraceEnableActivity(ActObjectCreate!)

TraceEnableActivity(ActObjectDestroy!)

TraceEnableActivity(ActGarbageCollect!)

 

TraceBegin("Trace_block_1")

// first block of code to be traced

// this block has the label Trace_block_1

 

TraceEnd()

 

// disable trace activities not needed for

// second block

TraceDisableActivity(ActLine! )

TraceDisableActivity(ActObjectCreate!)

TraceDisableActivity(ActObjectDestroy!)

TraceDisableActivity(ActGarbageCollect!)

 

TraceBegin("Trace_block_2")

// second block of code to be traced

 

TraceEnd()

TraceClose()

Screen of Example Trace App (In this case, the appeon library was used to develop the mobile app)

 

Regards !

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.