Worker statistics
Class function
nevis.system.getWorkerStatistics()
Returns statistics about the Navajo worker threads serving the current request.
The returned table contains the following fields:
- used: Number of worker threads currently in use.
- max: Maximum number of worker threads configured by the
MaxClientsserver setting. - free: Number of available worker threads. This is calculated as
max - used, or0if all workers are in use.
The function raises a Lua error if worker statistics are unavailable or contain invalid values.
Sample:
local workers = nevis.system.getWorkerStatistics()
local utilization = math.floor(workers.used * 100 / workers.max + 0.5)