Google
 
We have moved to a http://siebelunleased.com Please visit there for updated posts

Thursday, October 18, 2007

Siebel eScript – How to track performance with Timing Scripts

Timing scripts can come in handy to know exactly how much our code is taking to execute. There can be several reasons for doing this.

  • We are calling several business services in code and we need to know performance of each one.
  • We need to know time our script on business component, Applet is taking
  • We have several approaches to solve the problem and need to know the exact time taken by each.
The code to achieve that is:

var fileVar = Clib.fopen("c:\\Timing.txt", "at");
var timeVar = Clib.ctime(Clib.time());
Clib.fputs(timeVar + ": Starting trace in of code", fileVar);

//code which you want to track time
…………………………………….
…………………………………….

timeVar = Clib.ctime(Clib.time());
Clib.fputs("Ending trace of code: " + timeVar, fileVar);
Clib.fclose(fileVar);

    PS: This code will work only if you are trying to run it in dedicated client or your Siebel server is windows server. This code will fail if you are trying to run it from thin client and your Siebel Server is a unix server as it will not able to find the path. You will have to change the path to unix path e.g. /apps/srvr/bin if your server is unix.

    Hope this helps!!!!

    0 Comments:

    You Might want to read following articles also.