AZZLOGST ; DISPLAYS STATISTICS ON USER AND DEVICE LOGINS. [ 01/03/90 9:15 AM ]
; Mike Remillard, DDS, ISC/BAO
;
D ^AUKVAR
K AZZLO
D ^AUCLS W ?22,"* * * LOGIN STATISTICS * * *"
W !!,"This will take a minute, so enjoy the dots ..."
DATES ;
S X=$P($O(^XUSEC(0,0)),".")
S AZZLO("DATE")=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
S N=0 F I=1:1 S N=$O(^XUSEC(0,N)) Q:'N W:'(I#100) "." S X=N
S AZZLO("DATE1")=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
START ;
S N=0 F I=1:1 S N=$O(^XUSEC(0,N)) Q:'N W:'(I#10) "." D
.S AZZLO("DUZ")=$P(^XUSEC(0,N,0),U),AZZLO("DEV")=$P(^(0),U,2)
.I '$D(AZZLO(AZZLO("DUZ"))) S AZZLO(AZZLO("DUZ"))=0
.I '$D(AZZLO("DEV",AZZLO("DEV"))) S AZZLO("DEV",AZZLO("DEV"))=0
.S $P(AZZLO(AZZLO("DUZ")),U)=$P(AZZLO(AZZLO("DUZ")),U)+1
.S $P(AZZLO("DEV",AZZLO("DEV")),U)=$P(AZZLO("DEV",AZZLO("DEV")),U)+1
.K X S D0=N D TIME
.S:$D(X) $P(AZZLO(AZZLO("DUZ")),U,2)=$P(AZZLO(AZZLO("DUZ")),U,2)+X
.S:$D(X) $P(AZZLO("DEV",AZZLO("DEV")),U,2)=$P(AZZLO("DEV",AZZLO("DEV")),U,2)+X
NEXT ;
;-----> SET "B", "C", "E", AND "F" XREFS
;-----> "B" = NUMBER OF SIGNONS PER USER
;-----> "C" = TOTAL TIME PER USER
;-----> "E" = NUMBER OF SIGNONS PER DEVICE
;-----> "F" = TOTAL TIME PER DEVICE
S N=0 F I=1:1 S N=$O(AZZLO(N)) Q:'N W:'(I#10) "." S AZZLO("B",-$P(AZZLO(N),U),N)=N
S N=0 F I=1:1 S N=$O(AZZLO(N)) Q:'N W:'(I#10) "." S AZZLO("C",-$P(AZZLO(N),U,2),N)=N
S N=0 F I=1:1 S N=$O(AZZLO("DEV",N)) Q:'N W:'(I#10) "." S AZZLO("E",-$P(AZZLO("DEV",N),U),N)=N
S N=0 F I=1:1 S N=$O(AZZLO("DEV",N)) Q:'N W:'(I#10) "." S AZZLO("F",-$P(AZZLO("DEV",N),U,2),N)=N
H 1
;
D ^AZZLOGS1
EXIT ;
K AZZLO,I,N,X
D ^%AUCLS
Q
TIME ;
S X1=$P(^XUSEC(0,D0,0),U,4),X="" Q:X1<2000000 S X=D0,Y=$E(X1_"000",9,10)-$E(X_"000",9,10)*60+$E(X1_"00000",11,12)-$E(X_"00000",11,12),X2=X,X=$P(X,".",1)'=$P(X1,".",1) D ^%DTC:X S X=X*1440+Y
Q
AZZLOGST ; DISPLAYS STATISTICS ON USER AND DEVICE LOGINS. [ 01/03/90 9:15 AM ]
+1 ; Mike Remillard, DDS, ISC/BAO
+2 ;
+3 DO ^AUKVAR
+4 KILL AZZLO
+5 DO ^AUCLS
WRITE ?22,"* * * LOGIN STATISTICS * * *"
+6 WRITE !!,"This will take a minute, so enjoy the dots ..."
DATES ;
+1 SET X=$PIECE($ORDER(^XUSEC(0,0)),".")
+2 SET AZZLO("DATE")=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
+3 SET N=0
FOR I=1:1
SET N=$ORDER(^XUSEC(0,N))
IF 'N
QUIT
IF '(I#100)
WRITE "."
SET X=N
+4 SET AZZLO("DATE1")=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
START ;
+1 SET N=0
FOR I=1:1
SET N=$ORDER(^XUSEC(0,N))
IF 'N
QUIT
IF '(I#10)
WRITE "."
Begin DoDot:1
+2 SET AZZLO("DUZ")=$PIECE(^XUSEC(0,N,0),U)
SET AZZLO("DEV")=$PIECE(^(0),U,2)
+3 IF '$DATA(AZZLO(AZZLO("DUZ")))
SET AZZLO(AZZLO("DUZ"))=0
+4 IF '$DATA(AZZLO("DEV",AZZLO("DEV")))
SET AZZLO("DEV",AZZLO("DEV"))=0
+5 SET $PIECE(AZZLO(AZZLO("DUZ")),U)=$PIECE(AZZLO(AZZLO("DUZ")),U)+1
+6 SET $PIECE(AZZLO("DEV",AZZLO("DEV")),U)=$PIECE(AZZLO("DEV",AZZLO("DEV")),U)+1
+7 KILL X
SET D0=N
DO TIME
+8 IF $DATA(X)
SET $PIECE(AZZLO(AZZLO("DUZ")),U,2)=$PIECE(AZZLO(AZZLO("DUZ")),U,2)+X
+9 IF $DATA(X)
SET $PIECE(AZZLO("DEV",AZZLO("DEV")),U,2)=$PIECE(AZZLO("DEV",AZZLO("DEV")),U,2)+X
End DoDot:1
NEXT ;
+1 ;-----> SET "B", "C", "E", AND "F" XREFS
+2 ;-----> "B" = NUMBER OF SIGNONS PER USER
+3 ;-----> "C" = TOTAL TIME PER USER
+4 ;-----> "E" = NUMBER OF SIGNONS PER DEVICE
+5 ;-----> "F" = TOTAL TIME PER DEVICE
+6 SET N=0
FOR I=1:1
SET N=$ORDER(AZZLO(N))
IF 'N
QUIT
IF '(I#10)
WRITE "."
SET AZZLO("B",-$PIECE(AZZLO(N),U),N)=N
+7 SET N=0
FOR I=1:1
SET N=$ORDER(AZZLO(N))
IF 'N
QUIT
IF '(I#10)
WRITE "."
SET AZZLO("C",-$PIECE(AZZLO(N),U,2),N)=N
+8 SET N=0
FOR I=1:1
SET N=$ORDER(AZZLO("DEV",N))
IF 'N
QUIT
IF '(I#10)
WRITE "."
SET AZZLO("E",-$PIECE(AZZLO("DEV",N),U),N)=N
+9 SET N=0
FOR I=1:1
SET N=$ORDER(AZZLO("DEV",N))
IF 'N
QUIT
IF '(I#10)
WRITE "."
SET AZZLO("F",-$PIECE(AZZLO("DEV",N),U,2),N)=N
+10 HANG 1
+11 ;
+12 DO ^AZZLOGS1
EXIT ;
+1 KILL AZZLO,I,N,X
+2 DO ^%AUCLS
+3 QUIT
TIME ;
+1 SET X1=$PIECE(^XUSEC(0,D0,0),U,4)
SET X=""
IF X1<2000000
QUIT
SET X=D0
SET Y=$EXTRACT(X1_"000",9,10)-$EXTRACT(X_"000",9,10)*60+$EXTRACT(X1_"00000",11,12)-$EXTRACT(X_"00000",11,12)
SET X2=X
SET X=$PIECE(X,".",1)'=$PIECE(X1,".",1)
IF X
DO ^%DTC
SET X=X*1440+Y
+2 QUIT