Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMUT5C

XMUT5C.m

Go to the documentation of this file.
  1. XMUT5C ;(WASH ISC)/CAP-Response Time Logger/Purge ;04/17/2002 11:59
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; GO XMMGR-RESPONSE-TIME-COMPILER
  1. ; LOGON XMMGR-RESPONSE-TIME-TOGGLER
  1. I '$D(ZTQUEUED) U IO(0) W !!,"Compiling Data..."
  1. GO ;Entry for Tasked report
  1. ;
  1. S XMV=^%ZOSF("PROD"),(D,Z)=0
  1. ;
  1. ;Are there statistics to gather ? Only gather statistics till T-1.
  1. ;
  1. ;Is there a date ?
  1. Z S Z=$O(^%ZRTL(3,XMV,Z)) G Q:$H-Z'>0,Q:Z=""
  1. ;Is there Response Time data for MailMan ?
  1. S J=$O(^%ZRTL(3,XMV,Z,"XMA1-DEL/TERM",0)) D S:J
  1. ;
  1. ;Kill off Response time data for this date (stored in XMBX now)
  1. K ^%ZRTL(3,XMV,Z,"XMA1-DEL/TERM") G Z
  1. ;
  1. ;Gather 1 days' statistics
  1. S S %H=Z D YMD^%DTC S (E,XMA)=X,S=0
  1. I '$D(ZTQUEUED) W !,"DATE="_$$FMTE^XLFDT($P(XMA,".",1),"2Z"),! S D=D+1
  1. 0 S XMA=$O(^XMBX(4.2998,"B",XMA)) I $S('XMA:1,XMA-E>.999:1,1:0) Q
  1. S %=$P(XMA,".",2),L=$E(%,1,2)*3600+($E(%,3,4)*60)+$E(%,5,6),(C,T)=0 D G
  1. S %=$O(^XMBX(4.2998,"B",XMA,0)),$P(^XMBX(4.2998,%,0),U,8)=$S(C>0:$FN(T/C,"",1),1:"")
  1. G 0
  1. ;
  1. ;Get response time out of %ZRTL
  1. G S S=$O(^%ZRTL(3,XMV,Z,"XMA1-DEL/TERM",S)) Q:S="" I S>L S S=L Q
  1. S %=^(S),C=C+1,T=S-$P($P(%,"^"),",",2)+T I '$D(ZTQUEUED),C#100=0 W "."
  1. G G
  1. ;
  1. ;Write totals and quit
  1. Q I '$D(ZTQUEUED) W !!,?2,$S(D:D_" Dates Processed and Purged",1:"<<<< Nothing to process >>>>"),!
  1. K %,%H,%I,C,D,E,J,L,S,T,X,Y,Z,XMA,XMC,XMD,XMV
  1. Q
  1. ZTSK S ZTRTN="GO^XMUT5C",ZTDTH=$S($D(ZTQUEUED):1,1:0)+$H_","_(3600*18),ZTDESC="Response Time accumulator for file 4.2998",ZTIO="" D ^%ZTLOAD
  1. Q
  1. LOGON ;Turn ON response time logging
  1. S X="y" D LOG
  1. ;Schedule next task
  1. K ZTREQ S ZTIO="",ZTRTN="LOGOFF^XMUT5C",X=$P($H,",",2),ZTDESC="Turn OFF response Time Logging"
  1. K % I X<28800 S %=+$H_",29100"
  1. I X>57600 S %=$H+1_",29100"
  1. I $D(%) S ZTDTH=%
  1. E S %=$H*86400+X+300,ZTDTH=%\86400_","_(%#86400)
  1. D ^%ZTLOAD S ZTREQ="@" Q
  1. LOGOFF ;Turn OFF response time logging
  1. S X="n"
  1. ;Update Kernel Site Parameters LOG RESPONSE TIME FIELD
  1. LOG L +^XTV(8989.3,1)
  1. S %=^%ZOSF("VOL"),%=$O(^XTV(8989.3,1,4,"B",%,0)),$P(^XTV(8989.3,1,4,%,0),U,6)=X
  1. L -^XTV(8989.3,1) K %,X S ZTREQ="@"
  1. Q