| detectActiveCores | R Documentation |
This function counts the number of active system processes (threads) that match a given pattern and exceed a specified minimum CPU usage threshold. It works on Unix-like systems (e.g., Linux, macOS) and does not support Windows.
detectActiveCores(pattern = "", minCPU = 50)
pattern |
A character string used to filter process lines. Only
processes whose command line matches this pattern will be considered.
Default is |
minCPU |
A numeric value specifying the minimum CPU usage (in percent)
for a process to be considered active. Default is |
An integer representing the number of active threads matching the
pattern and exceeding the CPU usage threshold. Returns NULL with a
message if run on Windows.
This function uses the ps -ef system command and regular expressions
to parse CPU usage. It may not be portable across all Unix variants.
detectActiveCores(pattern = "R", minCPU = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.