mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Update cpu_time.yml (#19432)
Updates to cpu_time data table in Fleet Table Docs per https://github.com/fleetdm/fleet/issues/16993 --------- Co-authored-by: Eric <eashaw@sailsjs.com>
This commit is contained in:
parent
23ae7c763c
commit
d8489c4f2b
1 changed files with 16 additions and 3 deletions
|
|
@ -1,8 +1,21 @@
|
|||
name: cpu_time
|
||||
description: The `cpu_time` table displays data from the `/proc/stat` file which records how the Central Processing Unit (CPU) in a computer or mobile device allocates time to processing workloads.
|
||||
examples: |-
|
||||
Identify overworked CPUs using a ratio of system to user CPU usage. Here, a
|
||||
ratio of 2 was arbitrarily chosen.
|
||||
This query identifies Hosts on which the ratio of CPU time spent processing System workloads compared to User workloads is 2:1. This could be evidence of a corrupted operating system or malicious activity:
|
||||
|
||||
```
|
||||
SELECT * FROM cpu_time WHERE user/system>2;
|
||||
SELECT * FROM cpu_time WHERE user/system > 2;
|
||||
```
|
||||
|
||||
This query duplicates the macOS Activity Monitor.app GUI which shows the percentage of CPU time spent on System, User and Idle workloads:
|
||||
|
||||
```
|
||||
SELECT printf(ROUND((CAST(SUM(system) AS FLOAT)/(SUM(idle)+SUM(system)+SUM(user)))*100,2)) AS system_pct,
|
||||
printf(ROUND((CAST(SUM(user) AS FLOAT)/(SUM(idle)+SUM(system)+SUM(user)))*100,2)) AS user_pct,
|
||||
printf(ROUND((CAST(SUM(idle) AS FLOAT)/(SUM(idle)+SUM(system)+SUM(user)))*100,2)) AS idle_pct
|
||||
FROM cpu_time;
|
||||
```
|
||||
notes: |-
|
||||
[CPU time](https://en.wikipedia.org/wiki/CPU_time)
|
||||
|
||||
[Benchmarking code by referencing CPU time](https://dev.to/satrobit/cpu-time-how-to-accurately-benchmark-your-code-572p)
|
||||
|
|
|
|||
Loading…
Reference in a new issue