scaphandre
scaphandre copied to clipboard
Softawere - power_data.json is truncated
Bug description
I try to install Softawere following the documentation on a private physical Ubuntu server. I get an error in the boagent while reading the power_data.json file exported by Scaphandre, cf https://gitlab.com/softawere-hackathon/softawere/-/issues/16
To Reproduce
- docker-compose up in the softawere repository
- Check the json exported file by Scpahandre
cat /var/lib/docker/volumes/softawere_powerdata/_data/power_data.json
{"host":{"consumption":20424752.0,"timestamp":1685749774.9347048,"components":{"disks":[{"disk_type":"Unknown","disk_mount_point":"/etc/hosts".......
.....
un/containerd/containerd.sock","pid":293397,"resources_usage":null,"consumption":1704.8922,"timestamp":1685751231.2300694,"container":null}],"sockets":[{"id":0,"consumption":13674940.0,"domains":[{"name":"dram","consumption":7959161.0,"timestamp":1685751231.196572},{"name":"core","consumption":5104381.0,"timestamp":1685751231.196522}],"timestamp":1685751231.1958687}]}{"host":{"consumption":13545267.0,"timestamp":
The json file is truncated, is it a bug ?
Environment
Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-149-generic x86_64)
Possibly linked to issue #359 ?
Hi !
Thank you for documenting this issue, as said in #359 I tried a PR including a different initialization of the BufWriter, setting the size of the buffer.
Output of json exporter changes a bit too, as we ensure there is an opening '[', also ',' separators between host reports and an ending ']' when it is finished.
Let me know if you can try this branch before it makes it to dev, I'd love to hear feedbacks.
Hello, it seems that the ']' is still missing ! One should be careful to delete it at the concatenation !
To test:
scaphandre json -s 10 -f power_data.json
It does, when there is no timeout and the collection is not finished. As discussed in your case this is up to boagent to manage this output properly. Let's discuss about it in boagent or softawere issues :)