Note that there are some explanatory texts on larger screens.

plurals
  1. POGo- CPU/Memory/Network
    primarykey
    data
    text
    <p>I'm writing a cross-platform Go application that runs as a daemon. It basically listens for changes on the filesystem and copies/downloads changes to/from a server. The idea is that it should never slow down the machine, queueing tasks until the machine is idle.</p> <p>To do this, I would like to monitor CPU, RAM, and network usage, but network usage (if possible). I am currently targeting Windows 7+, Mac OS 10+, and Linux 3+.</p> <p>I'm primarily a Linux programmer, so I'm not familiar with Windows/BSD APIs, but I've already found some good information about BSD, so I think I can figure that out. I'm having trouble tracking down the Windows syscalls (I don't know of a way to get a Windows man page...). I've managed to find these resources (for Windows):</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms724400%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms724400%28VS.85%29.aspx</a></li> <li><a href="http://www.philosophicalgeek.com/2009/01/03/determine-cpu-usage-of-current-process-c-and-c/" rel="nofollow noreferrer">http://www.philosophicalgeek.com/2009/01/03/determine-cpu-usage-of-current-process-c-and-c/</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa373083%28v=vs.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/aa373083%28v=vs.85%29.aspx</a></li> <li><a href="https://stackoverflow.com/questions/2415085/is-it-possible-to-know-the-cpu-utilization-from-command-line">Is it possible to know the cpu utilization from a script</a></li> </ul> <p>I would prefer to use a syscall instead of shelling out/wrapping a C++ API. Obviously, I would be interested in any other Go libraries that already do this.</p> <p>Ultimately, I'm looking for something like this: <a href="http://nodejs.org/api/os.html" rel="nofollow noreferrer">http://nodejs.org/api/os.html</a></p> <p>I'm pretty much looking for syscalls and examples of how to use them.</p> <p>If I'm headed in the wrong direction, please let me know. I'm not married to the idea of polling the kernel for system information, but that seemed to me the most reliable way to get that information. I'd prefer to run the application as an underprivileged user.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload