-- File: StatsHot.mesa, Last Edit: HGM February 17, 1979 9:55 PM

-- Copyrig
ht Xerox Corporation 1979, 1980

DIRECTORY
StatsDef
s: FROM "StatsDefs" USING [StatCounterIndex],
Stats
PrivateDefs: FROM "StatsPrivateDefs" USING [statLock];

StatsHot: MONITOR LOCKS StatsPrivateDefs.stat
Lock
IMPORTS StatsPrivateDefs
EXPOR
TS StatsDefs, StatsPrivateDefs =
BEGIN OPEN StatsDefs;

-- These are the master counters.
They are the only ones that get bumped by StatIncr and StatBump. The numbers that StatSince prints out are obtained by subtracting two copies of statGrand.

statGrand: PUBLI
C ARRAY StatCounterIndex OF LONG CARDINAL;

StatIncr: PUBLIC ENTRY PROCEDURE [which: StatCounterIndex] =
BEGIN
sta
tGrand[which] ← statGrand[which]+1;
END;

StatBump: PUBLIC ENTRY PROCEDURE [which: StatCounterIndex, howmuch: CARDINAL] =
BEGIN
statGrand[which] ← statGrand[which]+howmuch;
END;

-- initialization
END.