Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Softawere - power_data.json is truncated #322

Closed
lcanagui opened this issue Jun 3, 2023 · 4 comments · Fixed by #382
Closed

Softawere - power_data.json is truncated #322

lcanagui opened this issue Jun 3, 2023 · 4 comments · Fixed by #382
Labels
bug Something isn't working

Comments

@lcanagui
Copy link

lcanagui commented Jun 3, 2023

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

  1. docker-compose up in the softawere repository
  2. 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)

@lcanagui lcanagui added the bug Something isn't working label Jun 3, 2023
@demeringo
Copy link
Contributor

Possibly linked to issue #359 ?

@bpetit bpetit linked a pull request Apr 22, 2024 that will close this issue
@bpetit
Copy link
Contributor

bpetit commented Apr 23, 2024

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.

@lcanagui
Copy link
Author

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

@bpetit
Copy link
Contributor

bpetit commented Apr 26, 2024

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 :)

@bpetit bpetit closed this as completed May 6, 2024
@bpetit bpetit added this to General Jun 19, 2024
@bpetit bpetit moved this to Done in General Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants