Posted: Sun Nov 25, 2007 1:01 pm Post subject: Balance the different services between the app. servers
Balance the different services between the app. servers: CPU time per workprocess type and application server
Code:
REPORT ZPROCTIM.
*
* This program sums the CPU time by workprocess type, and by
* application server, consumed by the workprocesses.
* It is useful, to help to balance the different
* services between the servers.
*
INCLUDE .
DATA: DEST(8), TAIL(5), HEAD(5).
DATA: SAPS TYPE I, SALL TYPE I, T1 TYPE I, T2 TYPE I, T3 TYPE I,
T4 TYPE I, T5 TYPE I, T6 TYPE I.
DATA: WITH_CPU TYPE X VALUE 10.
DATA: SRVNAME LIKE SPFID-APSERVER.
DATA: BEGIN OF SRV_TBL OCCURS 100.
INCLUDE STRUCTURE MSXXLIST.
DATA END OF SRV_TBL.
DATA: BEGIN OF WPLIST OCCURS 30.
INCLUDE STRUCTURE WPINFOS.
DATA: END OF WPLIST.
DATA: BEGIN OF LOC_WPLIST OCCURS 30.
INCLUDE STRUCTURE WPINFO.
DATA: END OF LOC_WPLIST.
DATA: BEGIN OF WPINFO OCCURS 30.
INCLUDE STRUCTURE WPINFO.
DATA: END OF WPINFO.
DATA: BEGIN OF PFNORM OCCURS 30.
INCLUDE STRUCTURE PFNORM.
DATA: END OF PFNORM.
DATA: BEGIN OF RES OCCURS 10,
HOST(8), TYPE(3), TIME TYPE I,
END OF RES.
DATA: BEGIN OF RES2 OCCURS 10,
TYPE(3), HOST(8), TIME TYPE I,
END OF RES2.
CALL FUNCTION 'TH_SERVER_LIST' DESTINATION '????'
TABLES
LIST = SRV_TBL.
REFRESH WPLIST.
LOOP AT SRV_TBL.
SRVNAME = SRV_TBL-NAME.
REFRESH LOC_WPLIST.
WITH_CPU = 1.
CALL FUNCTION 'TH_WPINFO' DESTINATION '????'
EXPORTING
SRVNAME = SRVNAME
TABLES
WPLIST = LOC_WPLIST
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
LOOP AT LOC_WPLIST.
MOVE-CORRESPONDING LOC_WPLIST TO WPLIST.
WPLIST-APSERVER = SRVNAME.
APPEND WPLIST.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT WPLIST.
DEST = WPLIST-APSERVER.
CALL FUNCTION 'TH_WP_DETAIL_INFO' DESTINATION DEST
EXPORTING
WP = WPLIST-WP_NO
WITH_CPU = WITH_CPU
IMPORTING
WPINFO = WPINFO
PFNORM = PFNORM.
RES-HOST = DEST. RES-TYPE = WPLIST-WP_TYP.
SPLIT WPINFO-WP_CPU AT ':' INTO HEAD TAIL.
RES-TIME = 60 * HEAD + TAIL.
COLLECT RES.
ENDLOOP.
LOOP AT RES.
AT NEW HOST.
WRITE: ' ' COLOR 2 NO-GAP,
RES-HOST COLOR 2 NO-GAP,
' ' COLOR 2 NO-GAP.
ENDAT.
ENDLOOP.
WRITE: ' ' COLOR 2 NO-GAP,
SYM_CUMULATED AS SYMBOL COLOR 2 NO-GAP,
'appserv' COLOR 2 NO-GAP,
' ' COLOR 2 NO-GAP,
SYM_CUMULATED AS SYMBOL COLOR 2 NO-GAP,
'all ' COLOR 2 NO-GAP.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.