创建一个 GUI 来绘制 Linux 中 CPU 使用情况的图表
我想编写一个 GUI 来实时显示 CPU 使用情况。我的目标是能够从 GUI 运行程序,然后一旦程序启动,就会运行 CPU 使用率图表,说明程序如何使用 CPU 资源。做这样的事情最简单的方法是什么?我正在 Linux 上进行开发,并且了解 (h)top 和 mpstat 等工具。
编辑:抱歉,我应该更具描述性。我怎样才能从顶部获得诸如CPU使用率之类的信息,并将其重定向到GUI,以实时图形形式说明它?
I want to write a GUI that graphs CPU usage in real time. My goal was to be able to run a program from the GUI, and then once the program has started, a graph of the CPU usage would run that would illustrate how the program was using CPU resources. What's the simplest way of doing something like this? I'm developing on Linux, and am aware of tools like (h)top and mpstat.
EDIT: I should be a bit more descriptive, sorry. How can I get something like CPU usage from top, and redirect it to a GUI that illustrates it into a graph form in real time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想查看 Qt 框架。 Qt 确实很好地支持 Linux 上的 GUI 开发。
You might want to check out Qt framework. Qt has really good support GUI development on Linux.