-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot.sh
More file actions
executable file
·32 lines (24 loc) · 845 Bytes
/
Copy pathplot.sh
File metadata and controls
executable file
·32 lines (24 loc) · 845 Bytes
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
#!/usr/local/bin/bash
# plot the topology evolution graph
# test on GNU bash, version 4.1.9(0)-release (amd64-portbld-freebsd7.4)
# yzhang 20130601
source ${TOPOLITEPATH}/topolite.conf.sh
function countnumber () {
filename=$1
[ -f $filename ] || return 1
f_date=${filename##*/}
f_date=${f_date%%.*}
nr_edge=$(gzip -dc ${filename} | wc -l)
nr_node=$(gzip -dc ${filename} | cut -f1,2 | perl -pe 's/\t/\n/' | ${_binpath}/uniq.pl | wc -l)
echo $f_date $nr_node $nr_edge
return 0
}
function processdir () {
for file in `find -s $1 -type f`; do
countnumber $file
done
}
processdir ${_v4monthlypath} > ${_statspath}/v4monthly.txt
processdir ${_v6monthlypath} > ${_statspath}/v6monthly.txt
gnuplot ${_binpath}/monthly.gnuplot
[ -f ${_statspath}/monthly.svg ] && cp -f ${_statspath}/monthly.svg ${_topopath}/monthly.svg