machine-measurements

2025-06-22

Perform measurements about CPU time, memory usage, etc.

Upstream URL

Author

Yukari Hafner <shinmera@tymoon.eu>

Maintainer

Yukari Hafner <shinmera@tymoon.eu>

License

zlib
README
## About Machine-Measurements This is an extension system to ''machine-state''(https://shinmera.com/project/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. :: common lisp (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: :: common lisp (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.

Dependencies (3)

  • documentation-utils
  • machine-state
  • precise-time

Dependents (0)

    • GitHub
    • Quicklisp