
DEFINITION MODULE Stats;

        (********************************************************)
        (*                                                      *)
        (*                  Traffic statistics                  *)
        (*                                                      *)
        (*  Programmer:         P. Moylan                       *)
        (*  Last edited:        24 January 2024                 *)
        (*  Status:             Working                         *)
        (*                                                      *)
        (*  We estimate arrival rate and mean service time for  *)
        (*  four kinds of traffic: POP3, SMTP normal, SMTP via  *)
        (*  submission port, and outgoing mail.                 *)
        (*                                                      *)
        (********************************************************)


FROM INIData IMPORT HINI;
FROM Names IMPORT ServiceType;

(* NOTE: ServiceType is defined as (POP, SMTP, MSA, IMAP).  This module *)
(* doesn't record any IMAP information, so to keep the type structure   *)
(* simple we'll use the "IMAP" service type, in this module only, to    *)
(* refer to outgoing mail.                                              *)

PROCEDURE LoadINIData (hini: HINI);

    (* Loads the estimates saved from the last run. *)

PROCEDURE RecordArrival (service: ServiceType);

    (* Records that a new arrival event happened at the current time.   *)

PROCEDURE RecordServiceTime (s: ServiceType;  ms: CARDINAL);

    (* In this case the argument is in milliseconds, but we record mean *)
    (* service time in floating point seconds.                          *)

END Stats.

