DSJ.STAGECPU

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nandha
Participant
Posts: 6
Joined: Wed Aug 31, 2005 4:51 pm

DSJ.STAGECPU

Post by nandha »

Hi:
We are calling the server routine in Parallel Job as AfterJob Routine.

I want to capture the CPU usage of the datastage job in statistics table.

We wrote a routine

StageCPUsec = DSGetStageInfo(DSJ.ME,StageName, DSJ.STAGECPU)

Stagename is passed through looping logic.

But the output i get is 0.0


Any help on what's wrong with this.

Regards,
Nandha
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I think you've listed the problem in your post - you are calling a Server function.

Do any of these DSGet* functions work for PX jobs? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sure, the DSGet* functions will return values for PX jobs; in fact you need to be careful and parse the results correctly. In this case, teh DSJ.STAGECPU will return a comma-separated list of CPU times per processing node. But values are only returned for active stages, not for passive ones!

Also, be aware that the DSJ.STAGECPU at 7.x (I haven't checked other versions) will not return CPU seconds used as per the documentation, but will return %age CPU used as an integer. To get the CPU used you will need to get the stage's START and END time or use the Stage's ELAPSED time (I prefer to do the calculation myself) and then compute the percentage from that number of seconds.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good to know.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nandha
Participant
Posts: 6
Joined: Wed Aug 31, 2005 4:51 pm

Post by nandha »

Thank you for the suggestions . I see this message in logfile "(total CPU: 0.03)" for the stages.

Can we take this as a CPU time in seconds. May be we will check for "total CPU:" and get the values.

SEQL_Err_Bin_Master,0: Operator completed. status: APT_StatusOk elapsed: 1.40 user: 0.02 sys: 0.01 (total CPU: 0.03)


Regards,
Nandha
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Nandha,

The log file shows the correct cumulative CPU time, and you can also use that approach to get the values, if you were asking a question with your last post.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I just got confirmation from IBM/Ascential for the ecase 461128*UK regarding the DSJ.STAGECPU code in DSGetStageInfo() returning a %age CPU value instead of the actual number of CPU seconds used.

They are going to "fix" the product documentation. Even though it sounds like they are avoiding fixing a problem in the code, it means that any code written to date will not have to be changed (even though it might not work the way the programmers originally expected).
Post Reply