Real-time stats collection and logging. Needs to be extended with stats container type given.

The real-time stats collection API is described in detail in Real-time Stats article.

Constructor

new (logf:String ‑> Void)

Creates a new stats collector instance.

Parameters:

logf

Log function. In most cases it will be server.stats.

Fields

info:StatsInfo

Stats container.

name:String

Stats name.

Methods

dynamic init ():StatsInfo

Initializes a new stats container. Needs to be overridden.

Returns:

New stats container.

dynamic update ():Void

Writes stats to log file. Needs to be overridden.

updated ():Void

Notifies collector that stats container was updated. Logs stats values if necessary.