INHOV2 ;JMB; 6 Jul 99 15:28;Verify Background Processes
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
Q
;
IN1(INI) ;Initialize Servers for process INI
;OUTPUT
; Initialized INDAT array
;
N INK
S INK=0 F S INK=$O(INDAT(INI,INK)) Q:'INK D
. S INDAT(INI,INK,"RUN")="N"
Q
;
IN2(INI) ;Handle tasked/non-tasked stats
;OUTPUT
; updated INDAT array for process INI
;
N INK,INT
Q:INTASKED
S INK="" F S INK=$O(INDAT(INI,INK)) Q:'$L(INK) D
.;main process - show process name and run status even if not running.
.I INK=0 S INT=INDAT(INI,INK,"RUN") I INT="N" K INDAT(INI,INK) S INDAT(INI,INK,"RUN")="N"
.;servers (INK>0), do not display them if not running.
.E K:INDAT(INI,INK,"RUN")="N" INDAT(INI,INK)
Q
;
DIS ;Display Report
D HD
;Display data
S INQ="" F S INQ=$O(INDAT(INQ)) Q:'INQ D OV(INQ,0) S INK="" F S INK=$O(INDAT(INQ,INK)) Q:'$L(INK) D
.W !,?1,INDAT(INQ,INK,"RUN")
.W:'INK ?TAB(1),$E(INDEST(INQ),1,30)
.W:INK>0 ?TAB(1)+2,"SERVER",INK
.;Display Last Run Update Stats
.D DIS1(0)
.W:$L($G(INDAT(INQ,INK,"MES"))) !,?TAB(1)+2,$E(INDAT(INQ,INK,"MES"),1,30)
.;Display Last Event Stats
.D DIS1(1)
.D:$L($O(INDAT(INQ,INK))) OV(INQ,1)
D FTR
Q
;
DIS1(DA) ;Display Stats
;INPUT: DA = 0 - Last Run Update Stats
; 1 - Last Event Stats
;
I DA=1,'$L($G(INDAT(INQ,INK,1,"ELS"))) Q
I DA=1,'$L($G(INDAT(INQ,INK,"MES"))) W !
W ?TAB(2),$J($$FT0^INHUTS($G(INDAT(INQ,INK,DA,"LRU"))),10)
W ?TAB(3),$J($$FT1^INHUTS($G(INDAT(INQ,INK,DA,"ELS")),1),7)
W ?TAB(4),$J($$FT1^INHUTS($G(INDAT(INQ,INK,DA,"MIN")),2),6)
W ?TAB(5),$J($$FT1^INHUTS($G(INDAT(INQ,INK,DA,"MAX")),2),6)
W ?TAB(6),$J($$FT1^INHUTS($G(INDAT(INQ,INK,DA,"AET")),2),6)
Q
;
OV(INQ,IN1) ;Handle overflow
;INPUT
; INQ - Process Id
; IN1 - 1 Repeat process name
; - 0 Do not repeat process name
Q:$Y<(IOSL-4)
W !!,"More..." F X=1:1:INPAR("REPAINT") Q:INTASKED R *%:1 Q:$T
D HD
;Repeat process name
W:IN1 !,INDEST(INQ)," Cont."
Q
;
HD ;Display header
;Clear screen
N SEL
W @IOF
W "Verify Background Process",?55,INDAT("CT")
D HD1
W !,?5,"Start Time: ",INDAT("ST")
W ?40," Number of Iterations: ",INITER
W !,?5," Run Time: ",INDAT("RT"),?40,"Avg Time per Iteration: ",INDAT("AR")
W !!
S SEL=$S(INPAR("DETAIL"):"DET",1:"BRF") D @SEL
W !,"---"
W ?TAB(1),"------------------------------",?TAB(2),"----------"
W ?TAB(3),"-------"
F X=TAB(4),TAB(5),TAB(6) W ?X,"------"
Q
DET ;Detail Report Header
W "Run",?TAB(1),"Background Process/",?TAB(2),"Last Run/"
W ?TAB(3)+6,"(defaults in seconds)"
W !,?TAB(1)+2,"Message",?TAB(2)," Last Msg",?TAB(3),"Elapsed"
W ?TAB(4)," Min",?TAB(5)," Max",?TAB(6)," Avg"
Q
BRF ;Brief Report Header
W ?TAB(3)+6,"(defaults in seconds)",!
W "Run",?TAB(1),"Background Process",?TAB(2),"Last Run"
W ?TAB(3),"Elapsed"
W ?TAB(4)," Min",?TAB(5)," Max",?TAB(6)," Avg"
Q
;
FTR ;Display footer
;
;Diplay legend if at least one process has RUN status equal to "Q".
W:INSIG !!,"NOTE: RUN=Q Stands for ""Background Process Signaled to Quit"""
Q:INTASKED
W !!,"Press any key to exit: "
Q
HD1 ;Display warning message
Q:'INWARN
W !,"WARNING: Report being run elsewhere. Results may not be accurate."
Q
INHOV2 ;JMB; 6 Jul 99 15:28;Verify Background Processes
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 QUIT
+4 ;
IN1(INI) ;Initialize Servers for process INI
+1 ;OUTPUT
+2 ; Initialized INDAT array
+3 ;
+4 NEW INK
+5 SET INK=0
FOR
SET INK=$ORDER(INDAT(INI,INK))
IF 'INK
QUIT
Begin DoDot:1
+6 SET INDAT(INI,INK,"RUN")="N"
End DoDot:1
+7 QUIT
+8 ;
IN2(INI) ;Handle tasked/non-tasked stats
+1 ;OUTPUT
+2 ; updated INDAT array for process INI
+3 ;
+4 NEW INK,INT
+5 IF INTASKED
QUIT
+6 SET INK=""
FOR
SET INK=$ORDER(INDAT(INI,INK))
IF '$LENGTH(INK)
QUIT
Begin DoDot:1
+7 ;main process - show process name and run status even if not running.
+8 IF INK=0
SET INT=INDAT(INI,INK,"RUN")
IF INT="N"
KILL INDAT(INI,INK)
SET INDAT(INI,INK,"RUN")="N"
+9 ;servers (INK>0), do not display them if not running.
+10 IF '$TEST
IF INDAT(INI,INK,"RUN")="N"
KILL INDAT(INI,INK)
End DoDot:1
+11 QUIT
+12 ;
DIS ;Display Report
+1 DO HD
+2 ;Display data
+3 SET INQ=""
FOR
SET INQ=$ORDER(INDAT(INQ))
IF 'INQ
QUIT
DO OV(INQ,0)
SET INK=""
FOR
SET INK=$ORDER(INDAT(INQ,INK))
IF '$LENGTH(INK)
QUIT
Begin DoDot:1
+4 WRITE !,?1,INDAT(INQ,INK,"RUN")
+5 IF 'INK
WRITE ?TAB(1),$EXTRACT(INDEST(INQ),1,30)
+6 IF INK>0
WRITE ?TAB(1)+2,"SERVER",INK
+7 ;Display Last Run Update Stats
+8 DO DIS1(0)
+9 IF $LENGTH($GET(INDAT(INQ,INK,"MES")))
WRITE !,?TAB(1)+2,$EXTRACT(INDAT(INQ,INK,"MES"),1,30)
+10 ;Display Last Event Stats
+11 DO DIS1(1)
+12 IF $LENGTH($ORDER(INDAT(INQ,INK)))
DO OV(INQ,1)
End DoDot:1
+13 DO FTR
+14 QUIT
+15 ;
DIS1(DA) ;Display Stats
+1 ;INPUT: DA = 0 - Last Run Update Stats
+2 ; 1 - Last Event Stats
+3 ;
+4 IF DA=1
IF '$LENGTH($GET(INDAT(INQ,INK,1,"ELS")))
QUIT
+5 IF DA=1
IF '$LENGTH($GET(INDAT(INQ,INK,"MES")))
WRITE !
+6 WRITE ?TAB(2),$JUSTIFY($$FT0^INHUTS($GET(INDAT(INQ,INK,DA,"LRU"))),10)
+7 WRITE ?TAB(3),$JUSTIFY($$FT1^INHUTS($GET(INDAT(INQ,INK,DA,"ELS")),1),7)
+8 WRITE ?TAB(4),$JUSTIFY($$FT1^INHUTS($GET(INDAT(INQ,INK,DA,"MIN")),2),6)
+9 WRITE ?TAB(5),$JUSTIFY($$FT1^INHUTS($GET(INDAT(INQ,INK,DA,"MAX")),2),6)
+10 WRITE ?TAB(6),$JUSTIFY($$FT1^INHUTS($GET(INDAT(INQ,INK,DA,"AET")),2),6)
+11 QUIT
+12 ;
OV(INQ,IN1) ;Handle overflow
+1 ;INPUT
+2 ; INQ - Process Id
+3 ; IN1 - 1 Repeat process name
+4 ; - 0 Do not repeat process name
+5 IF $Y<(IOSL-4)
QUIT
+6 WRITE !!,"More..."
FOR X=1:1:INPAR("REPAINT")
IF INTASKED
QUIT
READ *%:1
IF $TEST
QUIT
+7 DO HD
+8 ;Repeat process name
+9 IF IN1
WRITE !,INDEST(INQ)," Cont."
+10 QUIT
+11 ;
HD ;Display header
+1 ;Clear screen
+2 NEW SEL
+3 WRITE @IOF
+4 WRITE "Verify Background Process",?55,INDAT("CT")
+5 DO HD1
+6 WRITE !,?5,"Start Time: ",INDAT("ST")
+7 WRITE ?40," Number of Iterations: ",INITER
+8 WRITE !,?5," Run Time: ",INDAT("RT"),?40,"Avg Time per Iteration: ",INDAT("AR")
+9 WRITE !!
+10 SET SEL=$SELECT(INPAR("DETAIL"):"DET",1:"BRF")
DO @SEL
+11 WRITE !,"---"
+12 WRITE ?TAB(1),"------------------------------",?TAB(2),"----------"
+13 WRITE ?TAB(3),"-------"
+14 FOR X=TAB(4),TAB(5),TAB(6)
WRITE ?X,"------"
+15 QUIT
DET ;Detail Report Header
+1 WRITE "Run",?TAB(1),"Background Process/",?TAB(2),"Last Run/"
+2 WRITE ?TAB(3)+6,"(defaults in seconds)"
+3 WRITE !,?TAB(1)+2,"Message",?TAB(2)," Last Msg",?TAB(3),"Elapsed"
+4 WRITE ?TAB(4)," Min",?TAB(5)," Max",?TAB(6)," Avg"
+5 QUIT
BRF ;Brief Report Header
+1 WRITE ?TAB(3)+6,"(defaults in seconds)",!
+2 WRITE "Run",?TAB(1),"Background Process",?TAB(2),"Last Run"
+3 WRITE ?TAB(3),"Elapsed"
+4 WRITE ?TAB(4)," Min",?TAB(5)," Max",?TAB(6)," Avg"
+5 QUIT
+6 ;
FTR ;Display footer
+1 ;
+2 ;Diplay legend if at least one process has RUN status equal to "Q".
+3 IF INSIG
WRITE !!,"NOTE: RUN=Q Stands for ""Background Process Signaled to Quit"""
+4 IF INTASKED
QUIT
+5 WRITE !!,"Press any key to exit: "
+6 QUIT
HD1 ;Display warning message
+1 IF 'INWARN
QUIT
+2 WRITE !,"WARNING: Report being run elsewhere. Results may not be accurate."
+3 QUIT