msys.threadpool.stat

March 26, 2020 Contributors

Name

msys.threadpool.stat — Return stats regarding a threadpool

Synopsis

msys.threadpool.stat(threadpoolname_or_jobclassid);

threadpoolname_or_jobclassid: mixed

Description

**Configuration Change. ** This feature is available as of version 3.2.

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

msys.threadpool.find, msys.threadpool.count threadpool