aboutsummaryrefslogtreecommitdiffstats
path: root/timeplot
blob: c8240d05b613021fde0a3b272d74b4bb0ed48dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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