Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I added a daemon storage.
The idea is to create a server that accepts multiple socket connections.
The problem I had with the socket storage was that I needed to launch the formula before the sensor, and there was synchronization issues.
In the code I propose, a thread is running to accept socket connection, and the main thread send the reports to the opened connection. That way, a client can connect and disconnect at any time, while the sensor runs as a daemon.
The storage is launched with the name "daemon", and the P_flag :
sudo ./hwpc-sensor -n test -r daemon -P 8002 -s rapl -o -e RAPL_ENERGY_PKG
After, you just have to connect with a tcp client :
Dependency :
There is room for improvments: