'CPU Load' logging

Discussion in 'Tomato Firmware' started by besonen, Aug 28, 2009.

  1. besonen

    besonen LI Guru Member

    how can i log the 'CPU Load' stat?

  2. bogderpirat

    bogderpirat Network Guru Member

    you could create a script that is executed into background upon init and writes the contents of /proc/loadavg into a file every n seconds (or minutes). your only problem will then be cycling the contents of that file in case it gets too big. loadavg's output usually has a size of around 23-26 chracters, depending on the amount of processes executed (read: PIDs created) of the router.
    if you log, say, every 5 seconds, that amounts to 421KiB every day. at that rate, your ram would be full after a couple of days.
    i guess the way this could be implemented relies heavily on the way you want to access the data, and how much of it you actually need.
  3. Planiwa

    Planiwa Network Guru Member

    logger "LOADAVG: $(cat /proc/loadavg)"
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice