开发者

Tutorial for multi core CPU usage in c++ in unix

I would like t开发者_高级运维o know if someone can point me any library or tutorial to work with measurements. In a first moment, CPU usage, but latter I will need network (I've already found libcap, is this good?) and memory usages also.

I believe that each of then will be a different library or project, so thanks in advance.

I am currently working in a database monitoring system for UNIX system, in C++.

PS.: is there a way to access the htop programmatically from c++?

Pedro


Look into the /proc filesystem. It contains a bunch of plain-text files with system statistics. /proc/stat has cpu info, and /proc/net/* has network info.

Additionally, /proc/<pid>/* contains information about a specific process.


This is what I was looking for: http://developer.gnome.org/libgtop/stable/libgtop-white-paper.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜