Skip to main content


Last updated March 2020


msys.threadpool.stat — Return stats regarding a threadpool



threadpoolname_or_jobclassid: mixed


Supply a job class ID (integer) or name (string) to this function. A table is returned with the following fields.

  • name

  • invocations

  • avg_concurrency

  • saturation

  • avg_wallclock_time_per_op

  • queue_sz

  • num_threads

  • num_active_threads

  • num_inactive_threads

  • job_num_queued

  • job_num_running

If no thread pool exists with the given name or job class then nil is returned. This function is only safe to call from the scheduler thread. Summaries returned by this function include a pretty printer.

s = msys.threadpool.stat("SWAPIN");
print (s["invocations"]);
s = msys.threadpool.stat(1);
print (s["job_num_queued"]);

Enable this function with the statement require('msys.threadpool');.

See Also

Was this page helpful?