tables

Table components for displaying top CPU, memory, and GPU process information.

source

render_cpu_processes_table

 render_cpu_processes_table (top_cpu:list)

Render the CPU processes table.

Type Details
top_cpu list List of dictionaries containing top CPU-consuming process information
Returns FT A Div element containing the CPU processes table
from cjm_fasthtml_sysmon.monitors.processes import get_process_info

proc_info = get_process_info()
render_cpu_processes_table(top_cpu=proc_info['top_cpu'])
<div id="cpu-processes-table">
  <table class="table table-zebra table-xs w-full">
    <thead>
      <tr>
        <th class="text-xs w-16">PID</th>
        <th class="text-xs">Name</th>
        <th class="text-xs w-20">CPU %</th>
        <th class="text-xs w-24">Memory</th>
        <th class="text-xs">User</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="text-xs">2342</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-error badge-sm">83.9%</label>        </td>
        <td class="text-xs">78 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2338</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-error badge-sm">78.7%</label>        </td>
        <td class="text-xs">77 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2343</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-error badge-sm">78.7%</label>        </td>
        <td class="text-xs">77 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2341</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-error badge-sm">73.4%</label>        </td>
        <td class="text-xs">80 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">1888</td>
        <td class="text-xs font-medium">provjobd1095981550</td>
        <td>
<label class="badge badge-info badge-sm">21.0%</label>        </td>
        <td class="text-xs">33 MB</td>
        <td class="text-xs">runner</td>
      </tr>
    </tbody>
  </table>
</div>

source

render_memory_processes_table

 render_memory_processes_table (top_memory:list)

Render the memory processes table.

Type Details
top_memory list List of dictionaries containing top memory-consuming process information
Returns FT A Div element containing the memory processes table
from cjm_fasthtml_sysmon.monitors.processes import get_process_info

proc_info = get_process_info()
render_memory_processes_table(top_memory=proc_info['top_memory'])
<div id="memory-processes-table">
  <table class="table table-zebra table-xs w-full">
    <thead>
      <tr>
        <th class="text-xs w-16">PID</th>
        <th class="text-xs">Name</th>
        <th class="text-xs w-20">Memory %</th>
        <th class="text-xs w-24">Memory</th>
        <th class="text-xs">User</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="text-xs">2004</td>
        <td class="text-xs font-medium">Runner.Worker</td>
        <td>
<label class="badge badge-info badge-sm">0.8%</label>        </td>
        <td class="text-xs">125 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">1989</td>
        <td class="text-xs font-medium">Runner.Listener</td>
        <td>
<label class="badge badge-info badge-sm">0.6%</label>        </td>
        <td class="text-xs">91 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2341</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-info badge-sm">0.5%</label>        </td>
        <td class="text-xs">80 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2338</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-info badge-sm">0.5%</label>        </td>
        <td class="text-xs">78 MB</td>
        <td class="text-xs">runner</td>
      </tr>
      <tr>
        <td class="text-xs">2342</td>
        <td class="text-xs font-medium">python</td>
        <td>
<label class="badge badge-info badge-sm">0.5%</label>        </td>
        <td class="text-xs">78 MB</td>
        <td class="text-xs">runner</td>
      </tr>
    </tbody>
  </table>
</div>

source

render_gpu_processes_table_body

 render_gpu_processes_table_body (gpu_processes:list)

Render just the GPU processes table body.

Type Details
gpu_processes list List of dictionaries containing GPU process information
Returns FT A Div element containing the GPU processes table body

source

render_gpu_processes_table

 render_gpu_processes_table (gpu_processes:list)

Render the GPU processes table.

Type Details
gpu_processes list List of dictionaries containing GPU process information
Returns FT A Div element containing the GPU processes table
from cjm_fasthtml_sysmon.monitors.gpu import get_gpu_info

gpu_info = get_gpu_info()
render_gpu_processes_table(gpu_processes=gpu_info.get('processes', []))
FATAL ERROR: NVIDIA Management Library (NVML) not found.
HINT: The NVIDIA Management Library ships with the NVIDIA display driver (available at
      https://www.nvidia.com/Download/index.aspx), or can be downloaded as part of the
      NVIDIA CUDA Toolkit (available at https://developer.nvidia.com/cuda-downloads).
      The lists of OS platforms and NVIDIA-GPUs supported by the NVML library can be
      found in the NVML API Reference at https://docs.nvidia.com/deploy/nvml-api.
<div id="gpu-processes-table-body" class="bg-base-200 rounded-lg">
  <p class="text-sm text-base-content text-center p-4">No active GPU processes</p>
</div>