Skip to main content
Version: 9.2605.x RR

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 MaxClients server setting.
  • free: Number of available worker threads. This is calculated as max - used, or 0 if 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)