2

I have a jenkins job that is running some bash disk usage commands and storing them in a text file. For example:

du -sk /home/user/* > results.txt

will output the size in kilobytes of everything in /home/user/ into results.txt

I then want to somehow create a pie chart for /home/user/ with each line in results.txt being represented as a percentage. For example if one of the lines in results.txt is:

100 /home/user/somedir

And the total # of kilobytes is 1000 then /home/user/somedir should be represented as 10% on the pie chart.
I want this to be displayed in jenkins. How can I do this?

Mike Sallese
  • 827
  • 1
  • 10
  • 24

1 Answers1

0

I think gnuplot when I read it's about batch graph creating. Unfortunately it doesn't support pie chart yet, more precisely not directly yet. But they're some workaround (dirty tricks with polar coordinates and stuff) that have been shared on SO and SU

My second thought was ggplot2 but you'll need to learn R as it's made with that language and as extension for that application. Otherwise, plplot has binding to many programming languages ; but I'm not sure pie chart are that easy too.

My last thoughts was mermaidjs if you can rearrange your file (a little awk should suffice.) The same, you can consider vega-lite which require a little more complex JSON for more features. Same goes for ervy if you are nodejs guy (I never tried and it has been suggested by a colleague)

gildux
  • 448
  • 6
  • 12