Skip to content

Commit 4cde36c

Browse files
Added machine stats docs for capturing time series cpu utilization (#262)
1 parent ca1860c commit 4cde36c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pages/tidal tools/machine_stats.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ With this, you can also access this information on the Tidal Accelerator platfor
137137

138138
{% include image.html file="process_stats.png" %}
139139

140+
#### Capture CPU Utilization Time Series Data
141+
142+
To capture point-in-time CPU utilization data, you can use the `-CPUUtilizationOnlyValue` and `-CPUUtilizationTimeout` flags. When run this way, machine stats will capture the current CPU utilization of the machine, rather than peak and average over a given interval.
143+
144+
./runner.ps1 -CPUUtilizationOnlyValue -CPUUtilizationTimeout 1
145+
146+
You can use the `-Measurements` flag along with `tidal request` to upload the result to Tidal Accelerator.
147+
148+
./runner.ps1 -CPUUtilizationOnlyValue -CPUUtilizationTimeout 1 -Measurements | tidal request -X POST /api/v1/measurements/import
149+
150+
When run in a scheduled task (as outlined in the following section), it's possible to use machine stats to continuously capture CPU utilization data for a given server over time.
151+
140152
#### Run Machine Stats in a Scheduled Task
141153

142154
To run Machine Stats in a Windows scheduled task, we must first create the script which the scheduled task will execute. If you want to save the results as json files to the current directory, with a timestamp in the filename, you can use something like this (remember to replace `<path>` with the correct path):
@@ -331,6 +343,18 @@ With this, you can also access this information on the Tidal Accelerator platfor
331343
332344
{% include image.html file="process_stats.png" %}
333345
346+
#### Capture CPU Utilization Time Series Data
347+
348+
To capture point-in-time CPU utilization data, you can use the `--cpu-utilization-only-value` and `--cpu-utilization-timeout` flags. When run this way, machine stats will capture the current CPU utilization of the machine.
349+
350+
$ machine-stats --cpu-utilization-only-value --cpu-utilization-timeout 1
351+
352+
You can use the `-m` switch along with `tidal request` to upload the result to Tidal Accelerator.
353+
354+
$ machine-stats --cpu-utilization-only-value --cpu-utilization-timeout 1 -m | tidal request -X POST /api/v1/measurements/import
355+
356+
When run in a cron job (as outlined in the following section), it's possible to use machine stats to continuously capture CPU utilization data for a given server over time.
357+
334358
#### Run Machine Stats on a Cron Job
335359
336360
By leveraging cron, you can run Machines Stats on a schedule to gather data over a period of time.

0 commit comments

Comments
 (0)