From 00d21599ffee058d0d086eaf6b7be71a218ec896 Mon Sep 17 00:00:00 2001 From: Bruno Thomas Date: Wed, 13 Feb 2019 17:55:57 +0000 Subject: [PATCH] [utils] DS stats generation script --- stats.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 stats.sh diff --git a/stats.sh b/stats.sh new file mode 100755 index 0000000..3a27b12 --- /dev/null +++ b/stats.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +curl https://api.github.com/repos/ICIJ/datashare-installer/releases | jq -r '.[]|[.tag_name, .assets[].download_count] | @csv' > /tmp/ds_stats.csv +sed -i '1i release,mac,windows,linux' /tmp/ds_stats.csv + +function create_plot_file { +cat > /tmp/ds_stats.plot << EOF +set grid +set xtics rotate by -45 +set datafile separator "," + +set term png enhanced size 1024,800 +set output "ds_stats.png" + + set style data histogram + set style histogram rowstacked + set style fill solid border rgb "black" + set auto x + set yrange [0:*] + +set xlabel "releases" +set ylabel "nb downloads" +set title "Datashare downloads" +plot '/tmp/ds_stats.csv' using 3:xtic(1) title col, \ + '' using 2:xtic(1) title col, \ + '' using 4:xtic(1) title col +EOF +} + +create_plot_file +gnuplot /tmp/ds_stats.plot