XUCSXCD ;SFISC/HVB - CROSS-SITE CPU,DISK,RT for 486 SITES ;2/18/96 15:05
;;7.3;TOOLKIT;**14**;Dec 15, 1995
A Q:'$$CHKF^XUCSUTL S U="^" S:'$D(DT) DT=$$HTFM^XLFDT($H,1)
S XUCSEND=0 D A3^XUCSUTL3 G XIT:XUCSEND
S %ZIS="Q" D ^%ZIS I POP S POP=0 G XIT
I $D(IO("Q")) D G XIT
. S ZTSAVE("XUCS*")="",ZTRTN="DQ^XUCSXCD",ZTDESC="MPM X-SITE CPU,DISK,RT REPORT",ZTIO=ION
. S %DT="AEFRX",%DT("A")="Queue for what DATE/TIME? ",%DT("B")="NOW",%DT(0)="NOW" D ^%DT K %DT
. I +Y'<0 S ZTDTH=Y D ^%ZTLOAD,HOME^%ZIS
. K IO("Q")
U IO W:$E(IOST)="C" #
DQ ; Dequeue entry point
K CD,RT S X=0 F S X=$O(^XUCS(8987.2,X)) Q:X]"@"!(X="") S NODE=^(X,0) D:$D(^XUCS(8987.2,X))>1
. S FMDT=XUCSBD F S FMDT=$O(^XUCS(8987.2,"C",FMDT)) Q:FMDT="" Q:$D(^(FMDT,X))
. Q:FMDT="" S Y=$O(^XUCS(8987.2,"C",FMDT,X,0))-1
. F S Y=$O(^XUCS(8987.2,X,1,Y)) Q:Y]"@"!(Y="") S FMDT=^(Y,0) Q:FMDT>(XUCSED+.24) D:FMDT>XUCSBD&($D(^(5))>1)
. . I $E($P(FMDT,".",2),1,2)<12,XUCSRT="P" Q
. . I $E($P(FMDT,".",2),1,2)>11,XUCSRT="A" Q
. . F I=1:1:17 S $P(RT(NODE),"^",I)=$P($G(RT(NODE)),"^",I)+$P(^XUCS(8987.2,X,1,Y,5,I,0),"^",3)
. . S ET=^XUCS(8987.2,X,1,Y,0),RDT=$P(ET,"^"),ET=$P(ET,"^",3)
. . S X1=0 F S X1=$O(^XUCS(8987.2,X,1,Y,6,X1)) Q:+X1<1 S X0=^(+X1,0) D
. . . S $P(CD(NODE),"^",5)=$P($G(CD(NODE)),"^",5)+1
. . . F I=1:1:4 S $P(CD(NODE),"^",I)=$P(CD(NODE),"^",I)+$P(X0,"^",I+1)
P S Y=XUCSBD D DD^%DT S BD=Y,Y=XUCSED D DD^%DT S ED=Y D HDR
S (NODE,OSITE)="" F S NODE=$O(CD(NODE)) Q:NODE="" S Y=CD(NODE) D
. S SITE=$E(NODE,1,3) D:SITE'=OSITE&(OSITE]"") PRINT S OSITE=SITE,T=$E(NODE,4,5),@T=$G(@T)+1
. S (J,SEET,SUM)=0 I T="CS" F M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25 S J=J+1,CNT=$P(RT(NODE),"^",J),SEET=SEET+(CNT*M),SUM=SUM+CNT
. S S=+Y,TYPE(@T,T)=NODE_$J($P(Y,"^",2)/S*100,6,1)_$J($P(Y,"^",3)/S*100,6,1)_$J($P(Y,"^",4)/$P(Y,"^",5),4,0)_$S(T="CS"&SUM:$J(SEET/SUM,6,2),T="CS":" ",1:"")
PRINT Q:'$D(^DIC(4,OSITE,0)) D:$Y>(IOSL-7) HFF W !?1,$P(^DIC(4,OSITE,0),"^")
S STR="" F I=1:1 S $E(STR,1,29)=$J($G(TYPE(I,"CS")),29),$E(STR,30,53)=$J($G(TYPE(I,"FS")),24),$E(STR,54,77)=$J($G(TYPE(I,"PS")),24) Q:STR?1."" W !,STR Q:'$D(TYPE(I+1))
S (CS,FS,PS)=0 K TYPE W ! G XIT:NODE=""
Q
XIT I $E($G(IOST))'="C",'$D(ZTQUEUED) D ^%ZISC
K BD,CD,CNT,CS,ED,ET,FMDT,FS,I,J,M,NODE,OSITE,PS,RDT,RT,S,SEET,SITE
K STR,SUM,T,TYPE,X,X0,X1,XUCSBD,XUCSED,XUCSEND,XUCSRT,Y
Q
HFF W #
HDR W ?3,"MPM Cross-site Performance Report for ",BD," to ",ED," (",$S(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
W ! F I=1:1:3 W " Node CPU Disk Jobs" W:I=1 " RT "
W !?1 F I=1:1:77 W "="
W ! Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUCSXCD 2604 printed Oct 16, 2024@18:42:59 Page 2
XUCSXCD ;SFISC/HVB - CROSS-SITE CPU,DISK,RT for 486 SITES ;2/18/96 15:05
+1 ;;7.3;TOOLKIT;**14**;Dec 15, 1995
A if '$$CHKF^XUCSUTL
QUIT
SET U="^"
if '$DATA(DT)
SET DT=$$HTFM^XLFDT($HOROLOG,1)
+1 SET XUCSEND=0
DO A3^XUCSUTL3
if XUCSEND
GOTO XIT
+2 SET %ZIS="Q"
DO ^%ZIS
IF POP
SET POP=0
GOTO XIT
+3 IF $DATA(IO("Q"))
Begin DoDot:1
+4 SET ZTSAVE("XUCS*")=""
SET ZTRTN="DQ^XUCSXCD"
SET ZTDESC="MPM X-SITE CPU,DISK,RT REPORT"
SET ZTIO=ION
+5 SET %DT="AEFRX"
SET %DT("A")="Queue for what DATE/TIME? "
SET %DT("B")="NOW"
SET %DT(0)="NOW"
DO ^%DT
KILL %DT
+6 IF +Y'<0
SET ZTDTH=Y
DO ^%ZTLOAD
DO HOME^%ZIS
+7 KILL IO("Q")
End DoDot:1
GOTO XIT
+8 USE IO
if $EXTRACT(IOST)="C"
WRITE #
DQ ; Dequeue entry point
+1 KILL CD,RT
SET X=0
FOR
SET X=$ORDER(^XUCS(8987.2,X))
if X]"@"!(X="")
QUIT
SET NODE=^(X,0)
if $DATA(^XUCS(8987.2,X))>1
Begin DoDot:1
+2 SET FMDT=XUCSBD
FOR
SET FMDT=$ORDER(^XUCS(8987.2,"C",FMDT))
if FMDT=""
QUIT
if $DATA(^(FMDT,X))
QUIT
+3 if FMDT=""
QUIT
SET Y=$ORDER(^XUCS(8987.2,"C",FMDT,X,0))-1
+4 FOR
SET Y=$ORDER(^XUCS(8987.2,X,1,Y))
if Y]"@"!(Y="")
QUIT
SET FMDT=^(Y,0)
if FMDT>(XUCSED+.24)
QUIT
if FMDT>XUCSBD&($DATA(^(5))>1)
Begin DoDot:2
+5 IF $EXTRACT($PIECE(FMDT,".",2),1,2)<12
IF XUCSRT="P"
QUIT
+6 IF $EXTRACT($PIECE(FMDT,".",2),1,2)>11
IF XUCSRT="A"
QUIT
+7 FOR I=1:1:17
SET $PIECE(RT(NODE),"^",I)=$PIECE($GET(RT(NODE)),"^",I)+$PIECE(^XUCS(8987.2,X,1,Y,5,I,0),"^",3)
+8 SET ET=^XUCS(8987.2,X,1,Y,0)
SET RDT=$PIECE(ET,"^")
SET ET=$PIECE(ET,"^",3)
+9 SET X1=0
FOR
SET X1=$ORDER(^XUCS(8987.2,X,1,Y,6,X1))
if +X1<1
QUIT
SET X0=^(+X1,0)
Begin DoDot:3
+10 SET $PIECE(CD(NODE),"^",5)=$PIECE($GET(CD(NODE)),"^",5)+1
+11 FOR I=1:1:4
SET $PIECE(CD(NODE),"^",I)=$PIECE(CD(NODE),"^",I)+$PIECE(X0,"^",I+1)
End DoDot:3
End DoDot:2
End DoDot:1
P SET Y=XUCSBD
DO DD^%DT
SET BD=Y
SET Y=XUCSED
DO DD^%DT
SET ED=Y
DO HDR
+1 SET (NODE,OSITE)=""
FOR
SET NODE=$ORDER(CD(NODE))
if NODE=""
QUIT
SET Y=CD(NODE)
Begin DoDot:1
+2 SET SITE=$EXTRACT(NODE,1,3)
if SITE'=OSITE&(OSITE]"")
DO PRINT
SET OSITE=SITE
SET T=$EXTRACT(NODE,4,5)
SET @T=$GET(@T)+1
+3 SET (J,SEET,SUM)=0
IF T="CS"
FOR M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25
SET J=J+1
SET CNT=$PIECE(RT(NODE),"^",J)
SET SEET=SEET+(CNT*M)
SET SUM=SUM+CNT
+4 SET S=+Y
SET TYPE(@T,T)=NODE_$JUSTIFY($PIECE(Y,"^",2)/S*100,6,1)_$JUSTIFY($PIECE(Y,"^",3)/S*100,6,1)_$JUSTIFY($PIECE(Y,"^",4)/$PIECE(Y,"^",5),4,0)_$SELECT(T="CS"&SUM:$JUSTIFY(SEET/SUM,6,2),T="CS":" ",1:"")
End DoDot:1
PRINT if '$DATA(^DIC(4,OSITE,0))
QUIT
if $Y>(IOSL-7)
DO HFF
WRITE !?1,$PIECE(^DIC(4,OSITE,0),"^")
+1 SET STR=""
FOR I=1:1
SET $EXTRACT(STR,1,29)=$JUSTIFY($GET(TYPE(I,"CS")),29)
SET $EXTRACT(STR,30,53)=$JUSTIFY($GET(TYPE(I,"FS")),24)
SET $EXTRACT(STR,54,77)=$JUSTIFY($GET(TYPE(I,"PS")),24)
if STR?1.""
QUIT
WRITE !,STR
if '$DATA(TYPE(I+1))
QUIT
+2 SET (CS,FS,PS)=0
KILL TYPE
WRITE !
if NODE=""
GOTO XIT
+3 QUIT
XIT IF $EXTRACT($GET(IOST))'="C"
IF '$DATA(ZTQUEUED)
DO ^%ZISC
+1 KILL BD,CD,CNT,CS,ED,ET,FMDT,FS,I,J,M,NODE,OSITE,PS,RDT,RT,S,SEET,SITE
+2 KILL STR,SUM,T,TYPE,X,X0,X1,XUCSBD,XUCSED,XUCSEND,XUCSRT,Y
+3 QUIT
HFF WRITE #
HDR WRITE ?3,"MPM Cross-site Performance Report for ",BD," to ",ED," (",$SELECT(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
+1 WRITE !
FOR I=1:1:3
WRITE " Node CPU Disk Jobs"
if I=1
WRITE " RT "
+2 WRITE !?1
FOR I=1:1:77
WRITE "="
+3 WRITE !
QUIT