XMUT5Q1 ;(WASH ISC)/CAP-Delivery Queue Analysis (start/init) ;04/17/2002 12:02
;;8.0;MailMan;;Jun 28, 2002
; Entry points used by MailMan options (not covered by DBIA):
; OPTION XMMGR-DELIVERY-STATS-COLL
;
;R array is for responses
;M array is for messages
;
;("T")=total
;("N")=Not queued last check
;("D")=[time stamped entries] = frequency ^ total time in queue
;("O",I)=Oldest message for grouping I -- Up to 10 groupings
; 1st piece is frequency, 2nd piece is time in queue
;
;Killing XMUT5NO causes the process to be tasked into background
K XMUT5NO
;
;GET GROUPINGS INTERACTIVELY
0 K C S I=1 D GET^XMUT5Q Q:X[U S C("MGROUPS")=X
S I=2 D GET^XMUT5Q Q:X[U S C("RGROUPS")=X
G TASKED:$D(XMUT5NO)
;
1 W !!,"Run at 30-minute intervals !!",!!
;I X["?" W !,"This is the interval that backgroud tasks will be rescheduled.",!,"Long intervals may not pick up any data. Short intervals are best,",!,"because the times collected may be off by as much as the interval for the"
;I W !,"interval a message was in the queue for. ENTER THE NUMBER OF SECONDS !"
;I G 1
;I X'?1.N W " Enter a time in seconds" G 1
;I X<300 W " Intervals must be at least 5 minutes apart." G 1
;I X>1800 W " Intervals must be less than 1/2 hour." G 1
S XMUT5S=X
;
2 R !!,"How many times do you want to analyze the message delivery queue: 4//",X:DTIME I X="" S XMUT5F=0 G GO
I X["?" W !,"The analysis will be automatically rescheduled this number of times." G 2
I X'?1.N!(X>9999999) W $C(7),!,"Type in a number between 0 and 9999999." G 2
S XMUT5F=X
;
TASKED ;Don't queue task if $D(XMUT5NO)
G GO:$D(XMUT5NO)
;
W !!,"I am queuing this job to run on the next half-hour. It will run every half-hour",!,"on the hour until the task is deleted or it is stopped by setting",!,"^XMBPOST(""XMUT5STOP"")=1."
K ^XMBPOST("XMUT5STOP") D ZTSK^XMUT5Q W !!,"QUEUED !!! TASK # "_ZTSK,!!
Q
;
GO S %=$G(^XMB(1,1,6)) I $L(%) S C("MGROUPS")=$P(%,"^"),C("RGROUPS")=$P(%,"^",2)
GO2 ;
;
;Delete reschedule frequency just in case -- reschedules itself
S (DIE,DIC)="^DIC(19,",DIC(0)="",X="XMMGR-DELIVERY-STATS-COLL" D ^DIC
I Y>0 S DA=+Y,DR="202///@" D ^DIE
K DIC,DR,DIE
I '$D(ZTQUEUED) W !!,"Analysis of queue starts now !!!",!
S XMUT5=1 K A,B,M,R,RSP G ZTSK0^XMUT5Q:$D(^XMBPOST("XMUT5STOP"))
S (A,C,M,R)=0
F I="A","N","D","T",1:1:10 S:'I M(I)=0,R(I)=0 S:I M("O",I)=0,R("O",I)=0
S:'$D(XMUT5S) XMUT5S=1800 D ^XMUT5B
QUIT ;End process
G QUIT^XMUT5Q
NOTASK ;Run in foreground once
G NOTASK^XMUT5Q
OPTION ;
D ^XMUT5B,REC^XMUT5Q
I $D(ZTQUEUED) S ZTRTN="OPTION^XMUT5Q1" D GO^XMUT5Q S ZTREQ="@" Q
W !!,"Stats collected. If you would like them to be collected automatically",!
W !,"every 1/2 hour, please schedule this option via TaskMan.",!!
Q
XMUT5Q1 ;(WASH ISC)/CAP-Delivery Queue Analysis (start/init) ;04/17/2002 12:02
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Entry points used by MailMan options (not covered by DBIA):
+3 ; OPTION XMMGR-DELIVERY-STATS-COLL
+4 ;
+5 ;R array is for responses
+6 ;M array is for messages
+7 ;
+8 ;("T")=total
+9 ;("N")=Not queued last check
+10 ;("D")=[time stamped entries] = frequency ^ total time in queue
+11 ;("O",I)=Oldest message for grouping I -- Up to 10 groupings
+12 ; 1st piece is frequency, 2nd piece is time in queue
+13 ;
+14 ;Killing XMUT5NO causes the process to be tasked into background
+15 KILL XMUT5NO
+16 ;
+17 ;GET GROUPINGS INTERACTIVELY
0 KILL C
SET I=1
DO GET^XMUT5Q
IF X[U
QUIT
SET C("MGROUPS")=X
+1 SET I=2
DO GET^XMUT5Q
IF X[U
QUIT
SET C("RGROUPS")=X
+2 IF $DATA(XMUT5NO)
GOTO TASKED
+3 ;
1 WRITE !!,"Run at 30-minute intervals !!",!!
+1 ;I X["?" W !,"This is the interval that backgroud tasks will be rescheduled.",!,"Long intervals may not pick up any data. Short intervals are best,",!,"because the times collected may be off by as much as the interval for the"
+2 ;I W !,"interval a message was in the queue for. ENTER THE NUMBER OF SECONDS !"
+3 ;I G 1
+4 ;I X'?1.N W " Enter a time in seconds" G 1
+5 ;I X<300 W " Intervals must be at least 5 minutes apart." G 1
+6 ;I X>1800 W " Intervals must be less than 1/2 hour." G 1
+7 SET XMUT5S=X
+8 ;
2 READ !!,"How many times do you want to analyze the message delivery queue: 4//",X:DTIME
IF X=""
SET XMUT5F=0
GOTO GO
+1 IF X["?"
WRITE !,"The analysis will be automatically rescheduled this number of times."
GOTO 2
+2 IF X'?1.N!(X>9999999)
WRITE $CHAR(7),!,"Type in a number between 0 and 9999999."
GOTO 2
+3 SET XMUT5F=X
+4 ;
TASKED ;Don't queue task if $D(XMUT5NO)
+1 IF $DATA(XMUT5NO)
GOTO GO
+2 ;
+3 WRITE !!,"I am queuing this job to run on the next half-hour. It will run every half-hour",!,"on the hour until the task is deleted or it is stopped by setting",!,"^XMBPOST(""XMUT5STOP"")=1."
+4 KILL ^XMBPOST("XMUT5STOP")
DO ZTSK^XMUT5Q
WRITE !!,"QUEUED !!! TASK # "_ZTSK,!!
+5 QUIT
+6 ;
GO SET %=$GET(^XMB(1,1,6))
IF $LENGTH(%)
SET C("MGROUPS")=$PIECE(%,"^")
SET C("RGROUPS")=$PIECE(%,"^",2)
GO2 ;
+1 ;
+2 ;Delete reschedule frequency just in case -- reschedules itself
+3 SET (DIE,DIC)="^DIC(19,"
SET DIC(0)=""
SET X="XMMGR-DELIVERY-STATS-COLL"
DO ^DIC
+4 IF Y>0
SET DA=+Y
SET DR="202///@"
DO ^DIE
+5 KILL DIC,DR,DIE
+6 IF '$DATA(ZTQUEUED)
WRITE !!,"Analysis of queue starts now !!!",!
+7 SET XMUT5=1
KILL A,B,M,R,RSP
IF $DATA(^XMBPOST("XMUT5STOP"))
GOTO ZTSK0^XMUT5Q
+8 SET (A,C,M,R)=0
+9 FOR I="A","N","D","T",1:1:10
IF 'I
SET M(I)=0
SET R(I)=0
IF I
SET M("O",I)=0
SET R("O",I)=0
+10 IF '$DATA(XMUT5S)
SET XMUT5S=1800
DO ^XMUT5B
QUIT ;End process
+1 GOTO QUIT^XMUT5Q
NOTASK ;Run in foreground once
+1 GOTO NOTASK^XMUT5Q
OPTION ;
+1 DO ^XMUT5B
DO REC^XMUT5Q
+2 IF $DATA(ZTQUEUED)
SET ZTRTN="OPTION^XMUT5Q1"
DO GO^XMUT5Q
SET ZTREQ="@"
QUIT
+3 WRITE !!,"Stats collected. If you would like them to be collected automatically",!
+4 WRITE !,"every 1/2 hour, please schedule this option via TaskMan.",!!
+5 QUIT