You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a tiny script(s) that crunches the numbers on node record counts over time. Except for spark it's pretty out-of-the-box portable.
> for f in $(find . -type f -name '*stats.sh'); do echo;echo '>>>>>>'$f;echo; cat $f; done
>>>>>>./stats.sh
#!/usr/bin/env bash
# Does basic statistics and visualization for node record counts.
# Statistics are aggregated at the DAILY granularity, traversing as far back as the second argument value.
#
# Use: ./script.sh <nodes.json> <days>
#
# Where 'days' is the number of days back from now.
> count.txt
for i in $(seq 1 $2); do
commit=$(git rev-list --max-count 1 --before="$(date --date '-'"$i"' days' --iso-8601=minutes)" etccore)
n=0
if [[ ! -z $commit ]]; then
git checkout $commit -- $1
n=$(cat $1 | grep record | wc -l)
else
echo skipping "$i (set to 0)"
fi
echo "$n" >> count.txt
done
sed '1!G;h;$!d' count.txt | spark
git checkout etccore -- $1
echo latest count:$(cat $1 | grep record | wc -l)
# https://stackoverflow.com/a/9790056
perl -e 'use List::Util qw(max min sum); @a=();while(<>){$sqsum+=$_*$_; push(@a,$_)}; $n=@a;$s=sum(@a);$a=$s/@a;$m=max(@a);$mm=min(@a);$std=sqrt($sqsum/$n-($s/$n)*($s/$n));$mid=int @a/2;@srtd=sort @a;if(@a%2){$med=$srtd[$mid];}else{$med=($srtd[$mid-1]+$srtd[$mid])/2;};print "records:$n\nsum:$s\navg:$a\nstd:$std\nmed:$med\nmax:$m\min:$mm";' < count.txt | grep -v sum
rm count.txt
>>>>>>./allstats.sh
#!/usr/bin/env bash
# Use: ./allstats.sh 100 > STATS.md
for f in $(find . -type f -name '*nodes.json' | sort); do
echo "# $f"
echo -e \`\`\`
./stats.sh "$f" $1
echo -e \`\`\`
echo
done
Here's a tiny script(s) that crunches the numbers on node record counts over time. Except for
spark
it's pretty out-of-the-box portable../all.classic.blockd.info/nodes.json
./all.kotti.blockd.info/nodes.json
./all.mordor.blockd.info/nodes.json
./les.classic.blockd.info/nodes.json
./les.kotti.blockd.info/nodes.json
./les.mordor.blockd.info/nodes.json
The text was updated successfully, but these errors were encountered: