source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMUT5Q1.m@ 632

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1XMUT5Q1 ;(WASH ISC)/CAP-Delivery Queue Analysis (start/init) ;04/17/2002 12:02
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Entry points used by MailMan options (not covered by DBIA):
4 ; OPTION XMMGR-DELIVERY-STATS-COLL
5 ;
6 ;R array is for responses
7 ;M array is for messages
8 ;
9 ;("T")=total
10 ;("N")=Not queued last check
11 ;("D")=[time stamped entries] = frequency ^ total time in queue
12 ;("O",I)=Oldest message for grouping I -- Up to 10 groupings
13 ; 1st piece is frequency, 2nd piece is time in queue
14 ;
15 ;Killing XMUT5NO causes the process to be tasked into background
16 K XMUT5NO
17 ;
18 ;GET GROUPINGS INTERACTIVELY
190 K C S I=1 D GET^XMUT5Q Q:X[U S C("MGROUPS")=X
20 S I=2 D GET^XMUT5Q Q:X[U S C("RGROUPS")=X
21 G TASKED:$D(XMUT5NO)
22 ;
231 W !!,"Run at 30-minute intervals !!",!!
24 ;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"
25 ;I W !,"interval a message was in the queue for. ENTER THE NUMBER OF SECONDS !"
26 ;I G 1
27 ;I X'?1.N W " Enter a time in seconds" G 1
28 ;I X<300 W " Intervals must be at least 5 minutes apart." G 1
29 ;I X>1800 W " Intervals must be less than 1/2 hour." G 1
30 S XMUT5S=X
31 ;
322 R !!,"How many times do you want to analyze the message delivery queue: 4//",X:DTIME I X="" S XMUT5F=0 G GO
33 I X["?" W !,"The analysis will be automatically rescheduled this number of times." G 2
34 I X'?1.N!(X>9999999) W $C(7),!,"Type in a number between 0 and 9999999." G 2
35 S XMUT5F=X
36 ;
37TASKED ;Don't queue task if $D(XMUT5NO)
38 G GO:$D(XMUT5NO)
39 ;
40 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."
41 K ^XMBPOST("XMUT5STOP") D ZTSK^XMUT5Q W !!,"QUEUED !!! TASK # "_ZTSK,!!
42 Q
43 ;
44GO S %=$G(^XMB(1,1,6)) I $L(%) S C("MGROUPS")=$P(%,"^"),C("RGROUPS")=$P(%,"^",2)
45GO2 ;
46 ;
47 ;Delete reschedule frequency just in case -- reschedules itself
48 S (DIE,DIC)="^DIC(19,",DIC(0)="",X="XMMGR-DELIVERY-STATS-COLL" D ^DIC
49 I Y>0 S DA=+Y,DR="202///@" D ^DIE
50 K DIC,DR,DIE
51 I '$D(ZTQUEUED) W !!,"Analysis of queue starts now !!!",!
52 S XMUT5=1 K A,B,M,R,RSP G ZTSK0^XMUT5Q:$D(^XMBPOST("XMUT5STOP"))
53 S (A,C,M,R)=0
54 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
55 S:'$D(XMUT5S) XMUT5S=1800 D ^XMUT5B
56QUIT ;End process
57 G QUIT^XMUT5Q
58NOTASK ;Run in foreground once
59 G NOTASK^XMUT5Q
60OPTION ;
61 D ^XMUT5B,REC^XMUT5Q
62 I $D(ZTQUEUED) S ZTRTN="OPTION^XMUT5Q1" D GO^XMUT5Q S ZTREQ="@" Q
63 W !!,"Stats collected. If you would like them to be collected automatically",!
64 W !,"every 1/2 hour, please schedule this option via TaskMan.",!!
65 Q
Note: See TracBrowser for help on using the repository browser.