source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUTMTZ.m@ 1751

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1XUTMTZ ;SEA/RDS - Taskman: Toolkit: Test Utilities (General) ;10/01/97 15:11
2 ;;8.0;KERNEL;**67**;Jul 10, 1995
3LOAD ;Load up Queue jobs
4 W !,"This call will allow you to start a large number of tasks for",!,"TaskMan to run."
5 R !,"Enter the number of jobs to start: ",JOBS:DTIME Q:+JOBS'>0
6 L +^TMP("XUTMTZ") K ^TMP("XUTMTZ"),ZTIO,ZTUCI,ZTCPU W !,"use '^' for no device."
7 S %ZIS="Q" D ^%ZIS S TASKIO=POP
8 S %DT="AETSX",%DT("B")="NOW" D ^%DT Q:Y<1 S XUDTH=Y
9LD2 R !,"Entry point to use: ",RTN:DTIME
10 I RTN["?" D G LD2
11 . F I=3:1 S X=$T(+I) Q:X="" W:$E($P(X," ",2),1,2)=";;" !,X
12 I $T(@RTN)'[";;" W !,"Not valid" G LD2
13 W !,"=============================================================="
14 W !,"New Batch: ",$H,"...",$J,!,"Tasks: "
15 F QUASI=1:1:JOBS S ZTRTN=RTN_"^XUTMTZ",ZTDTH=XUDTH,ZTDESC=$T(@RTN)_", Job #"_QUASI S:TASKIO ZTIO="" D ^%ZTLOAD W ZTSK,", "
16 W !,"..............................................................."
17 D HOME^%ZIS L -^TMP("XUTMTZ")
18 Q
19 ;
20ERROR ;;Test Taskman's Error Handling
21 S ^TMP("XUTMTZ",$H,$J)=ZTSK_", TEST ERROR HANDLING"
22 H 1 X "ERROR "
23 ;
24BASIC ;;Basic Test With Hang
25 L +^TMP("XUTMTZ") S ^TMP("XUTMTZ",$H,$J)=ZTSK_", BASIC TEST"_U_ZTDESC
26 I IO]"" W "." S IONOFF=1
27 H 1 L -^TMP("XUTMTZ") Q
28 ;
29QUICK ;;Quick Test To Exercise Submanager
30 S FRANK="HONEST" Q
31 ;
32STOP ;;Test Stop Code
33 S ^TMP("XUTMTZ",$H,$J)=ZTSK_", STOP CODE TEST: "
34 H 60
35 I $$S^%ZTLOAD S ZTSTOP=1,^TMP("XUTMTZ",$H,$J)="Stop Request Acknowledged." Q
36 S ^TMP("XUTMTZ",$H,$J)="No Stop Request Detected." Q
37 ;
38SIZE ;TOOL--SIZE OF ROUTINES
39 X ^%ZOSF("RSEL") S ZT1="" F ZT=0:0 S ZT1=$O(^TMP($J,ZT1)) Q:ZT1="" X "ZL @ZT1 X ^%ZOSF(""SIZE"") W !,ZT1,?10,Y,?15,"" "",$P($P($T(+1),"";"",2),""-"",2,999)"
40 K ^TMP($J) Q
41 ;
42MULTPL ;test task--Test running multiple managers on different nodes of VAXcluster
43 L +^TMP("XUTMTZ") H 1
44 W !,"..............................................................."
45 W !,ZTSK,": ",$H,"...",$J
46 L -^TMP("XUTMTZ") Q
47 ;
48STOP2 ;;Test ZTSTOP code
49 F ZT=1:1:792 S X=$$S^%ZTLOAD Q:X W 9
50 I X S ZTSTOP=1
51 Q
52 ;
53WATCH ;DON'T QUEUE--watch tasks as they are scheduled and unscheduled
54 S ZTSK=0
55 F ZT=0:0 D LOOKUP W !,"Update: ",ZTU,?15,"Queued: ",ZTS,?30,"Late: ",ZTO,?40,"New: ",ZTN,?50,"Subs: ",ZTSU,?60,"Free Subs: ",ZTF R X:1 Q:X="^"
56 Q
57 ;
58LOOKUP ;WATCH--get data to show
59 S ZTH=$H,ZTR=$S($D(^%ZTSCH("RUN"))#2:^("RUN"),1:""),ZTU="off"
60 I ZTR S ZTU=ZTH-ZTR*86400+$P(ZTH,",",2)-$P(ZTR,",",2) I ZTU>99 S ZTU="late"
61 S ZT1=0,ZTO=0,ZTS=0 F ZT=0:0 S ZT1=$O(^%ZTSCH(ZT1)),ZT2="" Q:'ZT1 F ZT=0:0 S ZT2=$O(^%ZTSCH(ZT1,ZT2)) Q:'ZT2 S ZTS=ZTS+1,ZTH=$H I ZTH-ZT1*86400+$P(ZTH,",",2)-$P(ZT1,",",2)>0 S ZTO=ZTO+1
62 S ZTN=^%ZTSK(-1)-ZTSK,ZTSK=^(-1)
63 S ZTSU=0,ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("TASK",ZT1)) Q:ZT1="" S ZTSU=ZTSU+1
64 S ZTF=0 I $D(^%ZTSCH("SUB"))#2 S ZTF=^("SUB"),ZTSU=ZTSU+ZTF
65 Q
66 ;
67HANG ;;Wait five minutes then quit
68 H 300 Q
69 ;
70OWN ;;Hold a device until told to release it
71 F A=0:0 H 1 I $D(^%ZTSK(ZTSK,.4))#2 Q
72 Q
73 ;
74QOWN ;entry--queue an own task
75 S ZTRTN="OWN^XUTMTZ",ZTDTH=$H,ZTIO="",ZTDESC="Toad test 1",ZTSAVE("ZTREQ")="@" D ^%ZTLOAD Q
76 ;
77Q ;entry--queue a test task
78 S ZTRTN="QUICK^XUTMTZ",ZTDTH=$H,ZTIO="",ZTDESC="Toad test",ZTSAVE("ZTREQ")="@" D ^%ZTLOAD Q
79 ;
80DELAY ;;Record delay in start
81 S ZTN=$H,ZTO=$P(^%ZTSK(ZTSK,0),"^",6),Y=$$DIFF^%ZTM(ZTN,ZTO,0)
82 S ^TMP("XUTMTZ",ZTN,ZTSK)="DELAY^"_IO_"^"_ZTN_"^"_ZTO_"^"_Y
83 I $$S^%ZTLOAD("DELAY TIME IS "_Y)
84 Q
85PTASK ;;See if persistent status works.
86 S CNT=$G(^%ZTSCH("TASK",ZTSK,"CNT"),0)
87 S ^%ZTSCH("TASK",ZTSK,"CNT",CNT)=$$HTE^XLFDT($H)
88 I '$D(^%ZTSCH("TASK",ZTSK,"P")) S X=$$PSET^%ZTLOAD(ZTSK) H 15 HALT
89 H 30
90 S ^("CNT")=$G(^("CNT"))+1 I ^("CNT")>5 S X=$$PCLEAR^%ZTLOAD(ZTSK) Q
91 HALT
92 Q
Note: See TracBrowser for help on using the repository browser.