简体   繁体   English

使用React和Node获取CPU使用情况数据

[英]Getting cpu usage data using react and node

Is it possible to use nodes os.cpus() module on react? 是否可以在react上使用节点os.cpus()模块? Trying to figure out how to get real time cpu usage updates from node on a project on working on. 试图弄清楚如何从正在进行的项目上的节点获取实时cpu使用情况更新。 I have played around with react before but i am still a newb and i haven't touched on node yet, so this is proving to be difficult for me. 我以前玩过React,但是我还是个新手,还没有接触Node,所以这对我来说很难。

update: I need the cpu data to be displayed in the site i am making 更新:我需要将cpu数据显示在我正在制作的网站中

You can get the stats of the server system through an API call. 您可以通过API调用获取服务器系统的统计信息。

However, to get the stats of the client system is not possible as browsers are supposed to be run in sandbox mode to stop websites from reading the client system or changing it. 但是,获取客户端系统的统计信息是不可能的,因为浏览器应该以沙盒模式运行,以阻止网站读取或更改客户端系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM