KMPDSSR ;OAK/RAK - Resource Usage Monitor Status ;2/14/05 13:50
;;3.0;KMPD;;Jan 22, 2009;Build 42
;
FORMAT(KMPRLN) ;-format text for display
;-----------------------------------------------------------------------------
; KMPRLN.... return number of lines - called by referrence
;-----------------------------------------------------------------------------
;
N CHECK,LN,VERSION S LN=0 K TMP
;
; check environment
;D ENVCHECK^KMPRUTL1(.CHECK,1)
; if RUM turned on but background job not queued ask user if they want
; to queue it at this time.
;D:(+CHECK)=200 ENVCHECK^KMPRUTL1(.CHECK)
;
; if no kmprutl routine
S X="KMPRUTL" X ^%ZOSF("TEST") I '$T D Q
.S LN=LN+1
.D SET^VALM10(LN,"The CAPACITY MANAGEMENT - RUM package is not installed!")
;
; option data
D OPT^KMPDSSD("KMPR BACKGROUND DRIVER")
;
; background data
D BKGRND
;
; file data
D FILES
;
; routine version check
D ROUCHK^KMPDSSD1("R")
;
; node/cpu data
D CPU^KMPDSSD1
;
; mail group members
D MGRP^KMPDSSD1
;
; legend
D LEGEND
;
S KMPRLN=LN
;
Q
;
BKGRND ; rum background info
;
N DATA,DELTA,ENDT,I,STAT,STDT,Z
;
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN," Temporary collection global..")
S LN=LN+1
D SET^VALM10(LN," ^KMPTMP(""KMPR"").............. "_$S('$D(^KMPTMP("KMPR")):"NOT ",1:"")_"Present")
S LN=LN+1
D SET^VALM10(LN,"")
;
D PARAMS^KMPDUT("DATA") Q:'$D(DATA)
S DATA(2)=$G(DATA(2))
S STDT=$P(DATA(2),U,5),ENDT=$P(DATA(2),U,6),DELTA=$P(DATA(2),U,7)
S:$E(DELTA)=" " $E(DELTA)="0"
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN," RUM Dly Bckgrnd Last Start... "_$$FMTE^XLFDT(STDT))
S LN=LN+1
D SET^VALM10(LN," RUM Dly Bckgrnd Last Stop.... "_$$FMTE^XLFDT(ENDT))
S LN=LN+1
D SET^VALM10(LN," RUM Dly Bkgrnd Total Time.... "_DELTA)
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
S STDT=$P(DATA(2),U,8),ENDT=$P(DATA(2),U,9),DELTA=$P(DATA(2),U,10)
S:$E(DELTA)=" " $E(DELTA)="0"
D SET^VALM10(LN," RUM Wkly Backgrnd Last Start. "_$$FMTE^XLFDT(STDT))
S LN=LN+1
D SET^VALM10(LN," RUM Wkly Bckgrnd Last Stop... "_$$FMTE^XLFDT(ENDT))
S LN=LN+1
D SET^VALM10(LN," RUM Wkly Bckgrnd Total Time.. "_DELTA)
S LN=LN+1
D SET^VALM10(LN," RUM Purge Data After......... "_$P(DATA(2),U,11)_" weeks")
D TRANSTO^KMPDUTL7(1,2,.Z)
I '$D(Z) D SET^VALM10(LN," RUM Transmit Data to......... <>") S LN=LN+1
E D
.S I=$O(Z("")) I I'="" S LN=LN+1 D SET^VALM10(LN," RUM Transmit Data to......... "_I)
.F S I=$O(Z(I)) Q:I="" S LN=LN+1 D SET^VALM10(LN,$J(" ",33)_I)
S LN=LN+1
D SET^VALM10(LN,"")
;
Q
;
FILES ;-- file data
;
N TEXT,X
;
S LN=LN+1
D SET^VALM10(LN,$J(" ",35)_" # of Oldest Recent")
S LN=LN+1
D SET^VALM10(LN," File"_$J(" ",28)_"Entries Date Date")
S LN=LN+1
D SET^VALM10(LN," ------------------------- ------- ------- -------")
; file name
S TEXT=" 8971.1-"_$P($G(^DIC(8971.1,0)),U)
; number of entries
S TEXT=TEXT_$J(" ",35-$L(TEXT))_$J($FN($P($G(^KMPR(8971.1,0)),U,4),",",0),7)
; oldest date
S X=$$FMTE^XLFDT(+$O(^KMPR(8971.1,"B",0)),2)
S X=$S(X=0:"---",1:X)
S TEXT=TEXT_$J(" ",45-$L(TEXT))_X
; current date
S X=$$FMTE^XLFDT(+$O(^KMPR(8971.1,"B","A"),-1),2)
S X=$S(X=0:"---",1:X)
S TEXT=TEXT_$J(" ",55-$L(TEXT))_X
S LN=LN+1
D SET^VALM10(LN,TEXT)
;
Q
;
LEGEND ;-- display legend
;
S LN=LN+1 D SET^VALM10(LN,"")
S LN=LN+1 D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN," RUM = Resource Usage Monitor")
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDSSR 3577 printed Oct 16, 2024@17:41:34 Page 2
KMPDSSR ;OAK/RAK - Resource Usage Monitor Status ;2/14/05 13:50
+1 ;;3.0;KMPD;;Jan 22, 2009;Build 42
+2 ;
FORMAT(KMPRLN) ;-format text for display
+1 ;-----------------------------------------------------------------------------
+2 ; KMPRLN.... return number of lines - called by referrence
+3 ;-----------------------------------------------------------------------------
+4 ;
+5 NEW CHECK,LN,VERSION
SET LN=0
KILL TMP
+6 ;
+7 ; check environment
+8 ;D ENVCHECK^KMPRUTL1(.CHECK,1)
+9 ; if RUM turned on but background job not queued ask user if they want
+10 ; to queue it at this time.
+11 ;D:(+CHECK)=200 ENVCHECK^KMPRUTL1(.CHECK)
+12 ;
+13 ; if no kmprutl routine
+14 SET X="KMPRUTL"
XECUTE ^%ZOSF("TEST")
IF '$TEST
Begin DoDot:1
+15 SET LN=LN+1
+16 DO SET^VALM10(LN,"The CAPACITY MANAGEMENT - RUM package is not installed!")
End DoDot:1
QUIT
+17 ;
+18 ; option data
+19 DO OPT^KMPDSSD("KMPR BACKGROUND DRIVER")
+20 ;
+21 ; background data
+22 DO BKGRND
+23 ;
+24 ; file data
+25 DO FILES
+26 ;
+27 ; routine version check
+28 DO ROUCHK^KMPDSSD1("R")
+29 ;
+30 ; node/cpu data
+31 DO CPU^KMPDSSD1
+32 ;
+33 ; mail group members
+34 DO MGRP^KMPDSSD1
+35 ;
+36 ; legend
+37 DO LEGEND
+38 ;
+39 SET KMPRLN=LN
+40 ;
+41 QUIT
+42 ;
BKGRND ; rum background info
+1 ;
+2 NEW DATA,DELTA,ENDT,I,STAT,STDT,Z
+3 ;
+4 SET LN=LN+1
+5 DO SET^VALM10(LN,"")
+6 SET LN=LN+1
+7 DO SET^VALM10(LN," Temporary collection global..")
+8 SET LN=LN+1
+9 DO SET^VALM10(LN," ^KMPTMP(""KMPR"").............. "_$SELECT('$DATA(^KMPTMP("KMPR")):"NOT ",1:"")_"Present")
+10 SET LN=LN+1
+11 DO SET^VALM10(LN,"")
+12 ;
+13 DO PARAMS^KMPDUT("DATA")
if '$DATA(DATA)
QUIT
+14 SET DATA(2)=$GET(DATA(2))
+15 SET STDT=$PIECE(DATA(2),U,5)
SET ENDT=$PIECE(DATA(2),U,6)
SET DELTA=$PIECE(DATA(2),U,7)
+16 if $EXTRACT(DELTA)=" "
SET $EXTRACT(DELTA)="0"
+17 SET LN=LN+1
+18 DO SET^VALM10(LN,"")
+19 SET LN=LN+1
+20 DO SET^VALM10(LN," RUM Dly Bckgrnd Last Start... "_$$FMTE^XLFDT(STDT))
+21 SET LN=LN+1
+22 DO SET^VALM10(LN," RUM Dly Bckgrnd Last Stop.... "_$$FMTE^XLFDT(ENDT))
+23 SET LN=LN+1
+24 DO SET^VALM10(LN," RUM Dly Bkgrnd Total Time.... "_DELTA)
+25 SET LN=LN+1
+26 DO SET^VALM10(LN,"")
+27 SET LN=LN+1
+28 SET STDT=$PIECE(DATA(2),U,8)
SET ENDT=$PIECE(DATA(2),U,9)
SET DELTA=$PIECE(DATA(2),U,10)
+29 if $EXTRACT(DELTA)=" "
SET $EXTRACT(DELTA)="0"
+30 DO SET^VALM10(LN," RUM Wkly Backgrnd Last Start. "_$$FMTE^XLFDT(STDT))
+31 SET LN=LN+1
+32 DO SET^VALM10(LN," RUM Wkly Bckgrnd Last Stop... "_$$FMTE^XLFDT(ENDT))
+33 SET LN=LN+1
+34 DO SET^VALM10(LN," RUM Wkly Bckgrnd Total Time.. "_DELTA)
+35 SET LN=LN+1
+36 DO SET^VALM10(LN," RUM Purge Data After......... "_$PIECE(DATA(2),U,11)_" weeks")
+37 DO TRANSTO^KMPDUTL7(1,2,.Z)
+38 IF '$DATA(Z)
DO SET^VALM10(LN," RUM Transmit Data to......... <>")
SET LN=LN+1
+39 IF '$TEST
Begin DoDot:1
+40 SET I=$ORDER(Z(""))
IF I'=""
SET LN=LN+1
DO SET^VALM10(LN," RUM Transmit Data to......... "_I)
+41 FOR
SET I=$ORDER(Z(I))
if I=""
QUIT
SET LN=LN+1
DO SET^VALM10(LN,$JUSTIFY(" ",33)_I)
End DoDot:1
+42 SET LN=LN+1
+43 DO SET^VALM10(LN,"")
+44 ;
+45 QUIT
+46 ;
FILES ;-- file data
+1 ;
+2 NEW TEXT,X
+3 ;
+4 SET LN=LN+1
+5 DO SET^VALM10(LN,$JUSTIFY(" ",35)_" # of Oldest Recent")
+6 SET LN=LN+1
+7 DO SET^VALM10(LN," File"_$JUSTIFY(" ",28)_"Entries Date Date")
+8 SET LN=LN+1
+9 DO SET^VALM10(LN," ------------------------- ------- ------- -------")
+10 ; file name
+11 SET TEXT=" 8971.1-"_$PIECE($GET(^DIC(8971.1,0)),U)
+12 ; number of entries
+13 SET TEXT=TEXT_$JUSTIFY(" ",35-$LENGTH(TEXT))_$JUSTIFY($FNUMBER($PIECE($GET(^KMPR(8971.1,0)),U,4),",",0),7)
+14 ; oldest date
+15 SET X=$$FMTE^XLFDT(+$ORDER(^KMPR(8971.1,"B",0)),2)
+16 SET X=$SELECT(X=0:"---",1:X)
+17 SET TEXT=TEXT_$JUSTIFY(" ",45-$LENGTH(TEXT))_X
+18 ; current date
+19 SET X=$$FMTE^XLFDT(+$ORDER(^KMPR(8971.1,"B","A"),-1),2)
+20 SET X=$SELECT(X=0:"---",1:X)
+21 SET TEXT=TEXT_$JUSTIFY(" ",55-$LENGTH(TEXT))_X
+22 SET LN=LN+1
+23 DO SET^VALM10(LN,TEXT)
+24 ;
+25 QUIT
+26 ;
LEGEND ;-- display legend
+1 ;
+2 SET LN=LN+1
DO SET^VALM10(LN,"")
+3 SET LN=LN+1
DO SET^VALM10(LN,"")
+4 SET LN=LN+1
+5 DO SET^VALM10(LN," RUM = Resource Usage Monitor")
+6 ;
+7 QUIT