I was trying to use a node created by you named as "node-red-contrib-cpu" and it returns multiple objects at a time. What I was trying to do is to fetch payload value from each object and merge it into a single JS object or display each msg object individually. But I didn't succeed and I am not able to find any example related to that on google, so can you please help me on that.
I have just found a solution to my problem by using a switch node and comparing the msg.topic value to a particular string (core_1, core_2 and so on).
I am attaching the link to my flow code in case someone wants to try this or looking for a solution for this node. Here you go: https://drive.google.com/open?id=19oXR_3k__TYlTsTJKTDAdliHXoQuZef2
Sorry for the drive links, I will soon upload all my flow codes to github for easy access to all.
@BartButenaers , if you know any other better solution to this then please do share for people like me.
I would like to suggest you to please include few examples for your node on any platform like github, nodered.org or any other where you would like to. It will be a much help to better understand this node.
I have no access to Node-RED at the moment, so I cannot try your example at the moment.
You can choose whether you want 1 message containing the info of all cores, OR 1 message for each core separately. So I assume you have selected 'Output message for each core' and then you want to merge all those messages together into a single message. Isn't it easier that you let the node output a single message?
Thanks for sharing the documentation link but I have gone through it already and as you can see I got the desired output.
Yes, it is but what if you want to see performance for each individual cores for a system with multiple cores. I am assuming that you are referring to this method.
I have also posted my example/ use-case to the github. Here is the link for that.
It is some time ago that I wrote that cpu-node, and it indeed seems that you cannot have a single output message containing the information of all cpu's. I had completely forgotten that I haver added such an option... I'm getting old
Currently for each core you will get a message like this (with payload containing the usage percentage):
I could add a new option to the config screen:
But how should the corresponding output message need to look like?
Perhaps a msg.topic = "all_cores" and msg.payload containing an array like this:
Dave, that is weird.
Asked my wife an hour ago for feedback, and she had the same kind of response (about order, color, text ...).
But she didn't mentioned a word about the wonderfull developments behind the checkbox.
The both of you must have something in common .
So it would become something like this:
Yes, on NPM there are already tick boxes. So a bit tricky if I change it to a dropdown now, to break existing flows ...
You could indeed select them all at once, which perhaps makes no sense in most cases. But that is not really a problem since each tickbox provides its own dedicated topics to the corresponding messages. For example:
Though being an amateur in this area what all I can say is, this looks good and will serve the purpose very well.
And thanks for making the efforts to create this node
I have a added a new (0.0.3) version on Github, that contains the new checkbox.
If it looks like what you had in mind, please let me know so I can publish it on NPM !!
Meanwhile you can install this test version directly from Github via command line:
npm install bartbutenaers/node-red-contrib-cpu
All changes in a nutshell:
A section about new option has been added to the readme page. And for all 3 available options, message examples have been added.
The node's config screen has been updated. And the help in the info panel has also been extended:
The new checkbox will generate an array of information for all cpu's. In the next screenshot you will see the comparison to the existing 'send a separate message for each core usage' option:
I have gone through the new option and tested it on localhost as well as on an AWS instance and it indeed served the purpose. I would like to say thank you for putting all the efforts for creating this option.