machine measurements
1.0.0Perform measurements about CPU time, memory usage, etc.
Table of Contents
About Machine-Measurements
This is an extension system to machine-state to provide easier access to machine state over time, such as CPU utilisation, IO speed, etc.
How To
Create a measurement
you'd like to observe, then run measure
to draw a measurement. Each measurement
type has a constructor function with the same name.
(org.shirakumo.machine-state.measurements:cpu-% T)
(org.shirakumo.machine-state.measurements:measure *)
The every time measure
is invoked it'll probe the value again as well as the time difference since the last measurement. Returned are always three values: the measured value, the time difference in seconds as a double-float, and the measurement
object.
For example, to create a very simple utilization display:
(loop with m = (list (org.shirakumo.machine-state.measurements:cpu-% T)
(org.shirakumo.machine-state.measurements:memory-%)
(org.shirakumo.machine-state.measurements:storage-io T))
initially (format T "~5a ~5a ~6a~%~18{-~}~%" "CPU%" "MEM%" "IO(kb)" 0)
for (cpu mem io) = (mapcar #'org.shirakumo.machine-state.measurements:measure m)
do (format T "~5,1f ~5,1f ~6d~%" cpu mem (round (/ io 1024)))
(sleep 1))
; =>
; CPU% MEM% IO(kb)
; ------------------
; 100.0 43.1 0
; 17.9 43.1 0
; 18.5 43.2 452
; 29.9 43.2 0
; ...
And that's pretty much it. Please see the symbol index for an enumeration of all available measurements.
System Information
Definition Index
-
ORG.SHIRAKUMO.MACHINE-STATE.MEASUREMENTS
No documentation provided.-
EXTERNAL STRUCTURE CPU-%
Measures the CPU core utilization percentage CORE should be the core number to measure, or T for all cores. See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE CPU-BUSY
Measures the CPU busy time CORE should be the core number to measure, or T for all cores. See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE CPU-IDLE
Measures the CPU idle time CORE should be the core number to measure, or T for all cores. See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE GC-BUSY
Measures the time spent in GC in seconds See ORG.SHIRAKUMO.MACHINE-STATE:GC-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE GPU-%
Measures the GPU memory utilization percentage See ORG.SHIRAKUMO.MACHINE-STATE:GPU-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE GPU-BUSY
Measures the GPU busy time in seconds See ORG.SHIRAKUMO.MACHINE-STATE:GPU-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE GPU-FREE
Measures the GPU memory free space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:GPU-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE GPU-USED
Measures the GPU memory used space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:GPU-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE HEAP-%
Measures the GC used space percentage See ORG.SHIRAKUMO.MACHINE-STATE:GC-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE HEAP-FREE
Measures the GC free space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:GC-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE HEAP-TOTAL
Measures the GC total space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:GC-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE HEAP-USED
Measures the GC used space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:GC-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE MEASUREMENT
Base type for all measurements. See MEASURE See LAST-TIME See LAST-VALUE
-
EXTERNAL STRUCTURE MEMORY-%
Measures the memory used percentage See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE MEMORY-FREE
Measures the memory free space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE MEMORY-TOTAL
Measures the memory total space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE MEMORY-USED
Measures the memory used space in bytes See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE NETWORK-IO
Measures the network IO rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:NETWORK-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE NETWORK-READ
Measures the storage read rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:NETWORK-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE NETWORK-WRITE
Measures the storage write rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:NETWORK-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE PROCESS-BUSY
Measures the processor time the process has used in seconds See ORG.SHIRAKUMO.MACHINE-STATE:PROCESS-TIME See MEASUREMENT
-
EXTERNAL STRUCTURE PROCESS-IO
Measures the process IO rate in bytes/s See ORG.SHIRAKUMO.MACHINE-STATE:PROCESS-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE PROCESS-READ
Measures the process read rate in bytes/s See ORG.SHIRAKUMO.MACHINE-STATE:PROCESS-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE PROCESS-SIZE
Measures the process size in bytes See ORG.SHIRAKUMO.MACHINE-STATE:PROCESS-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE PROCESS-WRITE
Measures the process write rate in bytes/s See ORG.SHIRAKUMO.MACHINE-STATE:PROCESS-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-%
Measures the storage usde space percentage. DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-FREE
Measures the storage free space in bytes. DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-IO
Measures the storage IO rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-READ
Measures the storage read rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-TOTAL
Measures the storage total space in bytes DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-USED
Measures the storage used space in bytes DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-ROOM See MEASUREMENT
-
EXTERNAL STRUCTURE STORAGE-WRITE
Measures the storage write rate in bytes/s DEVICE should be the device name to measure, or T for all devices. See ORG.SHIRAKUMO.MACHINE-STATE:STORAGE-IO-BYTES See MEASUREMENT
-
EXTERNAL STRUCTURE UPTIME
Measures the time since the machine started in seconds See ORG.SHIRAKUMO.MACHINE-STATE:MACHINE-UPTIME See MEASUREMENT
-
EXTERNAL FUNCTION CPU-%
- CORE
- &REST
Create a cpu-% instance See CPU-% (type)
-
EXTERNAL FUNCTION CPU-BUSY
- CORE
- &REST
Create a cpu-busy instance See CPU-BUSY (type)
-
EXTERNAL FUNCTION CPU-IDLE
- CORE
- &REST
Create a cpu-idle instance See CPU-IDLE (type)
-
EXTERNAL FUNCTION GC-BUSY
Create a gc-busy instance See GC-BUSY (type)
-
EXTERNAL FUNCTION GPU-%
Create a gpu-% instance See GPU-% (type)
-
EXTERNAL FUNCTION GPU-BUSY
Create a gpu-busy instance See GPU-BUSY (type)
-
EXTERNAL FUNCTION GPU-FREE
Create a gpu-free instance See GPU-FREE (type)
-
EXTERNAL FUNCTION GPU-USED
Create a gpu-used instance See GPU-USED (type)
-
EXTERNAL FUNCTION HEAP-%
Create a heap-% instance See HEAP-% (type)
-
EXTERNAL FUNCTION HEAP-FREE
Create a heap-free instance See HEAP-FREE (type)
-
EXTERNAL FUNCTION HEAP-TOTAL
Create a heap-total instance See HEAP-TOTAL (type)
-
EXTERNAL FUNCTION HEAP-USED
Create a heap-used instance See HEAP-USED (type)
-
EXTERNAL FUNCTION LAST-TIME
- INSTANCE
- &REST
Returns the last time the measurement was performed. This is not a wall clock, but rather some monotonic time stamp that was taken the last time MEASURE was called. See MEASUREMENT
-
EXTERNAL FUNCTION (SETF LAST-TIME)
- VALUE
- INSTANCE
- &REST
No documentation provided. -
EXTERNAL FUNCTION LAST-VALUE
- INSTANCE
- &REST
Returns the last value that was measured. Note that this is usually a "raw" value before it was converted to a more easy-to-consume variant as is returned by MEASURE. See MEASUREMENT
-
EXTERNAL FUNCTION (SETF LAST-VALUE)
- VALUE
- INSTANCE
- &REST
No documentation provided. -
EXTERNAL FUNCTION MEMORY-%
Create a memory-% instance See MEMORY-% (type)
-
EXTERNAL FUNCTION MEMORY-FREE
Create a memory-free instance See MEMORY-FREE (type)
-
EXTERNAL FUNCTION MEMORY-TOTAL
Create a memory-total instance See MEMORY-TOTAL (type)
-
EXTERNAL FUNCTION MEMORY-USED
Create a memory-used instance See MEMORY-USED (type)
-
EXTERNAL FUNCTION NETWORK-IO
- DEVICE
- &REST
Create a network-io instance See NETWORK-IO (type)
-
EXTERNAL FUNCTION NETWORK-READ
- DEVICE
- &REST
Create a network-read instance See NETWORK-READ (type)
-
EXTERNAL FUNCTION NETWORK-WRITE
- DEVICE
- &REST
Create a network-write instance See NETWORK-WRITE (type)
-
EXTERNAL FUNCTION PROCESS-BUSY
Create a process-busy instance See PROCESS-BUSY (type)
-
EXTERNAL FUNCTION PROCESS-IO
Create a process-io instance See PROCESS-IO (type)
-
EXTERNAL FUNCTION PROCESS-READ
Create a process-read instance See PROCESS-READ (type)
-
EXTERNAL FUNCTION PROCESS-SIZE
Create a process-size instance See PROCESS-SIZE (type)
-
EXTERNAL FUNCTION PROCESS-WRITE
Create a process-write instance See PROCESS-WRITE (type)
-
EXTERNAL FUNCTION STORAGE-%
- DEVICE
- &REST
Create a storage-% instance See STORAGE-% (type)
-
EXTERNAL FUNCTION STORAGE-FREE
- DEVICE
- &REST
Create a storage-free instance See STORAGE-FREE (type)
-
EXTERNAL FUNCTION STORAGE-IO
- DEVICE
- &REST
Create a storage-io instance See STORAGE-IO (type)
-
EXTERNAL FUNCTION STORAGE-READ
- DEVICE
- &REST
Create a storage-read instance See STORAGE-READ (type)
-
EXTERNAL FUNCTION STORAGE-TOTAL
- DEVICE
- &REST
Create a storage-total instance See STORAGE-TOTAL (type)
-
EXTERNAL FUNCTION STORAGE-USED
- DEVICE
- &REST
Create a storage-used instance See STORAGE-USED (type)
-
EXTERNAL FUNCTION STORAGE-WRITE
- DEVICE
- &REST
Create a storage-write instance See STORAGE-WRITE (type)
-
EXTERNAL FUNCTION UPTIME
Create a uptime instance See UPTIME (type)
-
EXTERNAL GENERIC-FUNCTION MEASURE
- MEASUREMENT
- &REST
Perform a measurement. Returns three values: - The measured value as a double-float or (unsigned-byte 64) - The time difference in seconds since the last measurement as a double-float - The measurement object See MEASUREMENT
-
EXTERNAL SOURCE-TRANSFORM LAST-TIME
No documentation provided. -
EXTERNAL SOURCE-TRANSFORM (SETF LAST-TIME)
No documentation provided. -
EXTERNAL SOURCE-TRANSFORM LAST-VALUE
No documentation provided. -
EXTERNAL SOURCE-TRANSFORM (SETF LAST-VALUE)
No documentation provided.
-