| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Mike Nitz Beginner
 
  
 Joined: 09 Jun 2005
 Posts: 19
 Topics: 12
 Location: Kansas City, MO
 
 | 
			
				|  Posted: Tue Jan 10, 2006 6:42 pm    Post subject: How can I capture CPU% utilized per job through REXX? |   |  
				| 
 |  
				| I've tried to capture the CPU% utilized by each job through RMF monitor III reports, that was a bust.  I've tried to get the info from the SDSF DA panel, so far it's a nogo.  I've searched the forums & haven't found anything.  How can I trap this information??  I'm at my wit's end!!!! |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| semigeezer Supermod
 
 
 Joined: 03 Jan 2003
 Posts: 1014
 Topics: 13
 Location: Atlantis
 
 | 
			
				|  Posted: Tue Jan 10, 2006 9:28 pm    Post subject: |   |  
				| 
 |  
				| If you are willing to do a sampling and then wait a little, sampling again and doing some math, you can get the CPU time of each job by looking at the ASCBEJST field in each job's ASCB.  This post will give you an idea how to run the ASVT to get the ASCBs for all address spaces. You then check CHTRKID for the type to verify it is a job and ... well... look here for the rest about finding jobs. 
 
 Be sure to do a real sleep between samplings because you want your exec to be completely inactive during the sampling period.  the syscalls sleep function will do that (or any of a number of wait commands that use STIMER available on the web).  Also, if you are using a multi-CPU box, you'll need to define what CPU% means to you (CPUTime/Elapsed, or CPU/Elapsed/#CPUs, etc)
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nevilh Beginner
 
 
 Joined: 11 Aug 2004
 Posts: 115
 Topics: 0
 
 
 | 
			
				|  Posted: Wed Jan 11, 2006 5:10 am    Post subject: |   |  
				| 
 |  
				| ASCBEJST will give you elapsed time not CPU % utilized |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| DaveyC Moderator
 
  
 Joined: 02 Dec 2002
 Posts: 151
 Topics: 3
 Location: Perth, Western Australia
 
 | 
			
				|  Posted: Wed Jan 11, 2006 8:12 am    Post subject: |   |  
				| 
 |  
				|  	  | Quote: |  	  | ASCBEJST will give you elapsed time not CPU % utilized | 
 
 No, it's CPU time. AFAIK, this is what gets reported in the JESYSMSG output of batch jobs.
 
 
  	  | Code: |  	  | IEF374I STEP/PROTEUS /STOP  2006011.1650 CPU    0MIN 03.87SEC SRB
 
 | 
 _________________
 Dave Crayford
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| vjkumk Beginner
 
 
 Joined: 28 Sep 2005
 Posts: 98
 Topics: 33
 
 
 | 
			
				|  Posted: Wed Jan 11, 2006 9:47 am    Post subject: |   |  
				| 
 |  
				| use SYSVAR(SYSSRV) in REXX Use the following arguments to obtain information related to the system.
 SYSCPU the number of seconds of central processing unit (CPU) time used
 during the session in the form: seconds.hundredths-of-seconds.
 You can use the SYSCPU argument and the SYSSRV argument,
 which returns the number of system resource manager (SRM)
 service units, to evaluate the:
 Performance of applications
 Duration of a session.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nevilh Beginner
 
 
 Joined: 11 Aug 2004
 Posts: 115
 Topics: 0
 
 
 | 
			
				|  Posted: Wed Jan 11, 2006 12:19 pm    Post subject: |   |  
				| 
 |  
				| Time reported in message IEF374I includes SRB time and enclave time this is not the same as the time reported in ASCBEJST. Documention is specific 
  	  | Quote: |  	  | ASCBEJST DS    D -                 ELAPSED JOB STEP TIMING  UNSIGNED *                                  64 BIT BINARY NUMBER
 | 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| dtf Beginner
 
 
 Joined: 10 Dec 2004
 Posts: 110
 Topics: 8
 Location: Colorado USA
 
 | 
			
				|  Posted: Wed Jan 11, 2006 12:50 pm    Post subject: |   |  
				| 
 |  
				| If you happen to have STROBE, you might look into using it.  However, this may be overkill for what you are looking for. ________
 herbal vaporizers
 
 Last edited by dtf on Tue Feb 01, 2011 2:05 pm; edited 1 time in total
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Bill Dennis Advanced
 
  
 Joined: 03 Dec 2002
 Posts: 579
 Topics: 1
 Location: Iowa, USA
 
 | 
			
				|  Posted: Wed Jan 11, 2006 1:10 pm    Post subject: |   |  
				| 
 |  
				| Do you really want the percent of the CPU used overall by a given job? 
 Get the CPU time and ELAPSED time from SMF type30 JOB recs and calculate (x/(y*z)) * 100 = percent of available CPU consumed by one job
 x = CPU time used by job
 y = elapsed time of job
 z = number of processors available
 _________________
 Regards,
 Bill Dennis
 
 Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| semigeezer Supermod
 
 
 Joined: 03 Jan 2003
 Posts: 1014
 Topics: 13
 Location: Atlantis
 
 | 
			
				|  Posted: Wed Jan 11, 2006 2:44 pm    Post subject: |   |  
				| 
 |  
				| I went back and looked at the old code for TASID.  ascbejst is CPU time.  ascbsrbt is srb time.  Those 2 can be combined as mentioned.  Elapsed time is calculated current stck time - ascbints.  TASID numbers match those shown by SDSF and RMF (or at least they did the last time I looked).  There are other timings for various things.  Offhand, I forget how to tell the elapsed time of a particular job step, but I think there is a timestamp in the OUCB for that - or something like that. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| DaveyC Moderator
 
  
 Joined: 02 Dec 2002
 Posts: 151
 Topics: 3
 Location: Perth, Western Australia
 
 | 
			
				|  Posted: Mon Jan 16, 2006 7:30 am    Post subject: |   |  
				| 
 |  
				| nevilh, 
 I think you're confusing elapsed time with wall time. Also, enclave is an LE term, which has absolutley no relevence to this thread! If you don't belive me why don't you check out the SDSF source and see how CPU time is calculated. Normally you can find it in ISF.SISFSRC(ISFDA).
 
 Here's a snippet...
 
 
  	  | Code: |  	  | LM    R0,R1,ASCBEJST      GET ELAPSED JOB TCB TIME
 CLM   R0,B'1000',=X'00'   IS TOD ACCURATE?
 BE    DA00028A            BRANCH IF YES
 SR    R0,R0               ZERO OUT R0
 SR    R1,R1               ZERO OUT R1
 DA00028A DS    0H
 SRDL  R0,12               IN MICRO-SECONDS
 LM    R14,R15,ASCBSRBT    GET ELAPSED SRB TIME
 CLM   R14,B'1000',=X'00'   IS TOD ACCURATE?
 BE    DA00028B            BRANCH IF YES
 SR    R14,R14             ZERO OUT R14
 SR    R15,R15             ZERO OUT R15
 DA00028B DS    0H
 SRDL  R14,12              IN MICRO-SECONDS
 ALR   R1,R15              ADD TCB AND SRB TIME
 BNO   DA000028            BRANCH IF NO OVERFLOW
 AH    R0,=H'1'            HANDLE CARRY
 DA000028 DS    0H
 AR    R0,R14
 STM   R0,R1,USRCTIME      SET CURRENT CPU TIME USED
 
 | 
 _________________
 Dave Crayford
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |