source: WorldVistAEHR/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XUCSXDR.m@ 1581

Last change on this file since 1581 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 5.3 KB
RevLine 
[613]1XUCSXDR ;SFISC/HVB - Tabular Summary for 486 SITES ;3/21/96 07:58
2 ;;7.3;TOOLKIT;**14**;Dec 15, 1995
3A Q:'$$CHKF^XUCSUTL
4 S U="^" S:'$D(DT) DT=$$HTFM^XLFDT($H,1) S:'$D(DTIME) DTIME=300
5 S XUCSEND=0 D A3^XUCSUTL3 I XUCSEND K MAIL G XIT
6 S DIR("A")="Mail report",DIR("B")="NO",DIR(0)="Y" D ^DIR Q:$D(DIRUT)
7 I Y K XMY S MAIL=2,IOM=80 G DQ
8 S %ZIS="Q" D ^%ZIS I POP G XIT
9 I $D(IO("Q")) D G XIT
10 . S ZTSAVE("XUCS*")="",ZTRTN="DQ^XUCSXDR",ZTDESC="MPM TABULAR SUMMARY",ZTIO=ION
11 . S %DT="AEFRX",%DT("A")="Queue for what DATE/TIME? ",%DT("B")="NOW",%DT(0)="NOW" D ^%DT K %DT
12 . I +Y'<0 S ZTDTH=Y D ^%ZTLOAD,HOME^%ZIS
13 . K IO("Q")
14 U IO W:$E(IOST)="C" ! G DQ
15DR ; Daily Report in mail message - noninteractive
16 K XMY S MAIL=1,X=0 F S X=$O(^XUCS(8987.1,1,2,X)) Q:X]"@"!(X="") S XMY(^(X,0))=""
17 G NOT:'$D(XMY) S U="^",DT=$$HTFM^XLFDT($H,1),X1=DT,X2=-1 D C^%DTC S (XUCSBD,XUCSED)=X,XUCSRT="B"
18DQ ; Dequeue entry point
19 K CD,RT,ST,^TMP($J,"XUCS") S L=1,HDR(1)=" " F I=1:1:75 S HDR(1)=HDR(1)_"="
20 S XUCSUN=$S($D(XUCSUN):XUCSUN,1:"000"),NODE=XUCSUN_"@@@"
21 F S NODE=$O(^XUCS(8987.2,"B",NODE)) Q:NODE=""!(XUCSUN&($E(NODE,1,3)'=XUCSUN)) S X=$O(^(NODE,"")) D
22 . S FMDT=XUCSBD F S FMDT=$O(^XUCS(8987.2,"C",FMDT)) Q:FMDT="" Q:$D(^(FMDT,X))
23 . Q:FMDT="" S Y=$O(^XUCS(8987.2,"C",FMDT,X,0))-1
24 . 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)
25 . . I $E($P(FMDT,".",2),1,2)<12,XUCSRT="P" Q
26 . . I $E($P(FMDT,".",2),1,2)>11,XUCSRT="A" Q
27 . . F I=1:1:17 S $P(RT(NODE),U,I)=$P($G(RT(NODE)),U,I)+$P(^XUCS(8987.2,X,1,Y,5,I,0),U,3)
28 . . S X1=0 F S X1=$O(^XUCS(8987.2,X,1,Y,6,X1)) Q:+X1<1 S X0=^(+X1,0) D
29 . . . S $P(CD(NODE),U,5)=$P($G(CD(NODE)),U,5)+1
30 . . . F I=1:1:4 S $P(CD(NODE),U,I)=$P(CD(NODE),U,I)+$P(X0,U,I+1)
31 . . S $P(ST(NODE),U,21)=$P($G(ST(NODE)),U,21)+$P(FMDT,U,3)
32 . . S $P(ST(NODE),U,22)=$P(ST(NODE),U,22)+$P(FMDT,U,5)
33 . . F I=1:1:17 S $P(ST(NODE),U,I)=$P(ST(NODE),U,I)+$P(^XUCS(8987.2,X,1,Y,3,1,0),U,I)
34P I '$D(RT) W:'$D(ZTQUEUED) " NO DATA between ",$$FMTE^XLFDT(XUCSBD)," and ",$$FMTE^XLFDT(XUCSED)," for ",$P($G(^DIC(4,XUCSUN,0)),U),"!",! K MAIL G XIT
35 S Y=XUCSBD D DD^%DT S BD=Y,Y=XUCSED D DD^%DT S ED=Y D ISTR
36 S (NODE,OSITE)="" F S NODE=$O(ST(NODE)) Q:NODE="" D
37 . S SITE=$E(NODE,1,3) I SITE'=OSITE,OSITE]"" D PRINT
38 . S (J,SEET,SUM)=0 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),U,J),SEET=SEET+(CNT*M),SUM=SUM+CNT S:J=2 CUM=SUM
39 . S OSITE=SITE,TY=$E(NODE,4,5),X=ST(NODE),CNT=$P(X,U),SET=$P(X,U,21)
40 . S STR(1)=STR(1)_$J(NODE,7),Y=$G(CD(NODE)),S=+Y
41 . S STR(2)=STR(2)_$S(S:$J($P(Y,U,2)/S*100,7,0),1:" ")
42 . S STR(3)=STR(3)_$S(S:$J($P(Y,U,3)/S*100,7,0),1:" ")
43 . S STR(4)=STR(4)_$S(TY="CS"&SUM:$J(SEET/SUM,7,2),1:" ")
44 . S STR(5)=STR(5)_$S(TY="CS"&SUM:$J(CUM/SUM*100,7,0),1:" ")
45 . S STR(6)=STR(6)_$S(TY="CS"&SUM:$J(SUM/SET,7,1),1:" ")
46 . S STR(7)=STR(7)_$J($P(X,U,22)/CNT,7,0)
47 . S STR(8)=STR(8)_$S($P(X,U,13):$J($P(X,U,13)/SET,7,0),1:" ")
48 . S STR(9)=STR(9)_$S($P(X,U,14):$J($P(X,U,14)/SET,7,0),1:" ")
49 . S STR(10)=STR(10)_$J($P(X,U,16)/SET,7,0)
50 . S STR(11)=STR(11)_$J($P(X,U,7)/SET,7,0)
51 . S STR(12)=STR(12)_$J($P(X,U,5)+$P(X,U,6)/SET,7,0)
52 . S STR(13)=STR(13)_$J($P(X,U,2)/SET,7,0)
53 . S STR(14)=STR(14)_$J($P(X,U,3)/SET,7,0)
54 . S STR(15)=STR(15)_$S($P(X,U,9):$J($P(X,U,9)-$P(X,U,2)/$P(X,U,9)*100,7,0),1:" ")
55 . S STR(16)=STR(16)_$S($P(X,U,10):$J($P(X,U,10)-$P(X,U,3)/$P(X,U,10)*100,7,0),1:" ")
56 . S STR(17)=STR(17)_$S($P(X,U,11):$J($P(X,U,11)/SET,7,0),1:" ")
57 . S STR(18)=STR(18)_$S($P(X,U,12):$J($P(X,U,12)/SET,7,0),1:" ")
58 . S STR(19)=STR(19)_$S($P(X,U,12):$J($P(X,U,17)/$P(X,U,12)*100,7,0),1:" ")
59 . S STR(20)=STR(20)_$J(CNT,7,0)
60PRINT S HDR(2)=" "_$E($P($G(^DIC(4,OSITE,0)),U),1,20) F I=1:1:22-$L(HDR(2)) S HDR(2)=HDR(2)_" "
61 S HDR(2)=HDR(2)_" MPM Summary for "_BD_" to "_ED_" ("_$S(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
62 I $D(MAIL) D
63 . F I=1,2,1 S ^TMP($J,"XUCS",L)=HDR(I),L=L+1
64 . F I=1:1:20 S ^TMP($J,"XUCS",L)=STR(I),L=L+1
65 E D
66 . F I=1,2,1 W HDR(I),!
67 . F I=1:1:20 W STR(I),!
68 . I NODE]"" W @IOF
69 G XIT:NODE=""
70ISTR S STR(1)=" Node "
71 S STR(2)=" CPU Usage % "
72 S STR(3)=" Disk Usage % "
73 S STR(4)=" Response Time Sec "
74 S STR(5)=" RTs<2 Seconds % "
75 S STR(6)=" Responses/S "
76 S STR(7)=" Ave. # Jobs "
77 S STR(8)=" Term InChar/S "
78 S STR(9)=" Term OutChar/S "
79 S STR(10)=" M Commands/S "
80 S STR(11)=" Global Gets/S "
81 S STR(12)=" Global S&Ks/S "
82 S STR(13)=" Disk Reads/S "
83 S STR(14)=" Disk Writes/S "
84 S STR(15)=" Read Cache % "
85 S STR(16)=" Write Cache % "
86 S STR(17)=" DDP Requests/S "
87 S STR(18)=" RVG Requests/S "
88 S STR(19)=" RVG Cache % "
89 S STR(20)=" RTH Sessions "
90 Q
91NOT I $G(DUZ)\1 S XQA(DUZ)="",XQAMSG="No local CMP recipients in MSM RTHIST SITE file, no MPM Daily Summary" D SETUP^XQALERT K XQA,XQAMSG,MAIL
92XIT I $D(MAIL) S XMDUZ="MPM",XMTEXT="^TMP($J,""XUCS"",",XMSUB=$S(MAIL=1:"MPM Morning Report for "_+$E(XUCSBD,4,5)_"/"_+$E(XUCSBD,6,7)_"/"_$E(XUCSBD,2,3),1:"MPM Summary Report"),XMCHAN=1 D ^XMD
93 I $E($G(IOST))'="C",'$D(ZTQUEUED) D ^%ZISC
94 K BD,CD,CNT,CUM,DIR,ED,FMDT,HDR,I,J,L,M,MAIL,NODE,OSITE,RT,S,SEET
95 K SET,SITE,ST,STR,SUM,TY,X,X0,X1,X2,XMY,XMCHAN,XMDUZ,XMSUB,XMTEXT
96 K XUCSBD,XUCSED,XUCSEND,XUCSRT,XUCSUN,Y
97 Q
98ONE ; One site only
99 S U="^",DT=$$HTFM^XLFDT($H,1),DIR("A")="Select MPM Site",DIR(0)="P^4:EMZ" D ^DIR Q:$D(DIRUT) S XUCSUN=$P(Y,U) G A
Note: See TracBrowser for help on using the repository browser.