aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/timeplot
diff options
context:
space:
mode:
Diffstat (limited to 'dist-tools/timeplot')
-rwxr-xr-xdist-tools/timeplot40
1 files changed, 40 insertions, 0 deletions
diff --git a/dist-tools/timeplot b/dist-tools/timeplot
new file mode 100755
index 00000000..c8240d05
--- /dev/null
+++ b/dist-tools/timeplot
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# timeplot -- plot data on fetchmail release intervals
+#
+#
+
+# Get data from the NEWS file
+timeseries | awk >/tmp/timeplot$$ '
+START {maxdiff = 0;}
+/^[#%]/ {next;}
+ {days[count++] = $6;}
+END {
+ for (i = 0; i < count-1; i++)
+ {
+ diffs[i] = days[i] - days[i + 1];
+ if (maxdiff < diffs[i])
+ maxdiff = diffs[i];
+ }
+ for (i = 0; i <= maxdiff; i++)
+ freq[i] = 0;
+ for (i = 0; i < count - 1; i++)
+ {
+ freq[diffs[i]]++;
+ }
+ for (i = 0; i <= maxdiff; i++)
+ printf("%d %d\n", i, freq[i]);
+ }
+'
+
+gnuplot >time.png - <<EOF
+set xlabel "Release interval (days)"
+set ylabel "Interval frequency"
+plot '/tmp/timeplot$$' using 1:2 \
+ title "Release interval frequency"
+pause 9999
+EOF
+
+rm -f /tmp/time*
+
+# timeplot ends here