[613] | 1 | KMPDTP1 ;OAK/RAK - CP Timing Time to Load Summary ;2/17/04 09:22
|
---|
| 2 | ;;2.0;CAPACITY MANAGEMENT TOOLS;**4**;Mar 22, 2002
|
---|
| 3 | ;
|
---|
| 4 | EN ;-- entry point
|
---|
| 5 | N KMPDATE,KMPDPTNP,KMPDTTL,POP,X,Y,ZTDESC,ZTRTN,ZTRSAVE,%ZIS
|
---|
| 6 | S KMPDTTL=" Average Coversheet Time-to-Load (TTL) Report "
|
---|
| 7 | D HDR^KMPDUTL4(KMPDTTL)
|
---|
| 8 | W !
|
---|
| 9 | W !?7,"This report displays the daily average time-to-load value for"
|
---|
| 10 | W !?7,"the coversheet at this site. Average time-to-load values are"
|
---|
| 11 | W !?7,"given for either daily prime time or non-prime time periods."
|
---|
| 12 | W !
|
---|
| 13 | ;
|
---|
| 14 | I '$O(^KMPD(8973.2,0)) D Q
|
---|
| 15 | .W !!?7,"*** There is currently no data in file #8973.2 (CP TIMING) ***"
|
---|
| 16 | ;
|
---|
| 17 | D DATERNG^KMPDTU10("ORWCV",7,.KMPDATE)
|
---|
| 18 | Q:$G(KMPDATE(0))=""
|
---|
| 19 | S KMPDPTNP=$$PTNPSEL^KMPDUTL4
|
---|
| 20 | Q:'KMPDPTNP
|
---|
| 21 | ; select output device.
|
---|
| 22 | S %ZIS="Q",%ZIS("A")="Device: ",%ZIS("B")="HOME"
|
---|
| 23 | W ! D ^%ZIS I POP W !,"No action taken." Q
|
---|
| 24 | ; if queued.
|
---|
| 25 | I $D(IO("Q")) K IO("Q") D Q
|
---|
| 26 | .S ZTDESC=KMPDTTL
|
---|
| 27 | .S ZTRTN="EN1^KMPDTP1"
|
---|
| 28 | .S ZTSAVE("KMPDATE(")="",ZTSAVE("KMPDPTNP")="",ZTSAVE("KMPDTTL")=""
|
---|
| 29 | .D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
|
---|
| 30 | .D EXIT
|
---|
| 31 | ;
|
---|
| 32 | ; if output to terminal display message.
|
---|
| 33 | W:$E(IOST,1,2)="C-" !,"Compiling timing stats..."
|
---|
| 34 | D EN1
|
---|
| 35 | ;
|
---|
| 36 | Q
|
---|
| 37 | ;
|
---|
| 38 | EN1 ;-- entry point from taskman
|
---|
| 39 | Q:'$D(KMPDATE)
|
---|
| 40 | Q:'$G(KMPDPTNP)
|
---|
| 41 | K ^TMP($J)
|
---|
| 42 | D DATA,PRINT,EXIT
|
---|
| 43 | K ^TMP($J)
|
---|
| 44 | Q
|
---|
| 45 | ;
|
---|
| 46 | DATA ;-- compile data
|
---|
| 47 | Q:'$D(KMPDATE)
|
---|
| 48 | Q:'$G(KMPDPTNP)
|
---|
| 49 | N DATA,DATE,DOT,END,IEN,PTNP,QUEUED
|
---|
| 50 | S DATE=$P(KMPDATE(0),U)-.1,END=$P(KMPDATE(0),U,2),PTNP=(+KMPDPTNP)
|
---|
| 51 | Q:'DATE!('END)!('PTNP)
|
---|
| 52 | S DOT=1,QUEUED=$D(ZTQUEUED)
|
---|
| 53 | F S DATE=$O(^KMPD(8973.2,"ASSDTPT","ORWCV",DATE)) Q:'DATE!(DATE>END) D
|
---|
| 54 | .S IEN=0,^TMP($J,DATE)=""
|
---|
| 55 | .F S IEN=$O(^KMPD(8973.2,"ASSDTPT","ORWCV",DATE,PTNP,IEN)) Q:'IEN D
|
---|
| 56 | ..Q:'$D(^KMPD(8973.2,IEN,0)) S DATA=^(0) Q:DATA=""
|
---|
| 57 | ..I 'QUEUED S DOT=DOT+1 W:'(DOT#1000) "."
|
---|
| 58 | ..; if delta
|
---|
| 59 | ..I $P(DATA,U,4)'="" D
|
---|
| 60 | ...; minimum delta
|
---|
| 61 | ...I $P(^TMP($J,DATE),U,2)=""!($P(DATA,U,4)<$P(^TMP($J,DATE),U,2)) D
|
---|
| 62 | ....S $P(^TMP($J,DATE),U,2)=$P(DATA,U,4)
|
---|
| 63 | ...; maximum delta
|
---|
| 64 | ...I $P(DATA,U,4)>$P(^TMP($J,DATE),U,3) S $P(^TMP($J,DATE),U,3)=$P(DATA,U,4)
|
---|
| 65 | ...; total delta
|
---|
| 66 | ...S $P(^TMP($J,DATE),U,4)=$P(^TMP($J,DATE),U,4)+$P(DATA,U,4)
|
---|
| 67 | ...; count
|
---|
| 68 | ...S $P(^TMP($J,DATE),U,5)=$P(^TMP($J,DATE),U,5)+1
|
---|
| 69 | ..; if no delta
|
---|
| 70 | ..E S $P(^TMP($J,DATE),U,6)=$P(^TMP($J,DATE),U,6)+1
|
---|
| 71 | .;
|
---|
| 72 | .; back to DATE level
|
---|
| 73 | .; average
|
---|
| 74 | .S:$P(^TMP($J,DATE),U,5) $P(^TMP($J,DATE),U)=$P(^TMP($J,DATE),U,4)/$P(^TMP($J,DATE),U,5)
|
---|
| 75 | ;
|
---|
| 76 | Q
|
---|
| 77 | ;
|
---|
| 78 | PRINT ;-- print data
|
---|
| 79 | U IO
|
---|
| 80 | D HDR
|
---|
| 81 | Q:'$D(^TMP($J))
|
---|
| 82 | N DATE,TOTAL S (DATE,TOTAL)=""
|
---|
| 83 | F S DATE=$O(^TMP($J,DATE)) Q:'DATE S DATA=^TMP($J,DATE) D
|
---|
| 84 | .W !,$$FMTE^XLFDT(DATE,2)
|
---|
| 85 | .W ?12,$J($FN($P(DATA,U),",",0),10)
|
---|
| 86 | .W ?26,$J($FN($P(DATA,U,2),",",0),10)
|
---|
| 87 | .W ?40,$J($FN($P(DATA,U,3),",",0),10)
|
---|
| 88 | .W ?54,$J($FN($P(DATA,U,5),",",0),10)
|
---|
| 89 | .; total incompletes
|
---|
| 90 | .S TOTAL=TOTAL+$P(DATA,U,6)
|
---|
| 91 | ;
|
---|
| 92 | W !!?12,"Incomplete: ",$J($FN(TOTAL,",",0),$L(TOTAL)+2)
|
---|
| 93 | ; legend
|
---|
| 94 | W !!?2,"CV = Coversheet",!?2,"TTL = Time-to-Load"
|
---|
| 95 | ; pause if output to terminal
|
---|
| 96 | D CONTINUE^KMPDUTL4("Press RETURN to continue",4)
|
---|
| 97 | Q
|
---|
| 98 | ;
|
---|
| 99 | HDR ;-- print header
|
---|
| 100 | W @IOF
|
---|
| 101 | S X=$G(KMPDTTL)
|
---|
| 102 | W !?(80-$L(X)\2),X
|
---|
| 103 | S X=$P($G(KMPDPTNP),U,2)
|
---|
| 104 | W !?(80-$L(X)\2),X
|
---|
| 105 | S X=$G(KMPDATE(0)),X=$P(X,U,3)_" - "_$P(X,U,4)
|
---|
| 106 | W !?(80-$L(X)\2),X,?61,"Printed: ",$$FMTE^XLFDT(DT,2)
|
---|
| 107 | W !
|
---|
| 108 | W !?12,"|---------------Seconds---------------|"
|
---|
| 109 | W !,"Date",?12,"Average TTL",?26,"Minimum TTL",?40,"Maximum TTL",?54,"# of CV Loads"
|
---|
| 110 | W !,$$REPEAT^XLFSTR("-",IOM)
|
---|
| 111 | ;
|
---|
| 112 | Q
|
---|
| 113 | ;
|
---|
| 114 | EXIT ;-- cleanup on exit
|
---|
| 115 | S:$D(ZTQUEUED) ZTREQ="@"
|
---|
| 116 | D ^%ZISC
|
---|
| 117 | K KMPDATE,KMPDPTNP,KMPDTTL
|
---|
| 118 | Q
|
---|