dockerized nodejs容器应用程序监视自己的分配的CPU使用
我希望我的容器化Nodejs应用程序能够跟踪自己的CPU使用情况,但找不到方法(我发现的只是监视主机内核的使用情况)。 我不想在容器内使用Docker统计数据,因为它需要在特权模式下运行它。
I want my containerized NodeJS app to be able to track its own CPU usage but don't find a way of doing it (all I found is to monitor the host cores usage).
I don't want to use docker stats inside the container because it would need to run it in privilege mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用以下方法找到了解决方案:
@adobe/adobe/cgroup/cgroup-metrics < /代码>
> cpu count gist(function getCpulimits()):
https:/github.com /xiaoxiaojx/get_cpus_length/blob/master/index.js
I found the solution using:
@adobe/cgroup-metrics
CPU count gist (function getCpuLimits()): https://github.com/xiaoxiaojx/get_cpus_length/blob/master/index.js