git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@977
959494ce-11ee-0310-bf91-
de5d638817bd
--- /dev/null
+#!/bin/bash
+
+rm -f plot-*
+
+./statcomp gstat | while read k x avg dev dl dh min max; do
+ echo "$x $dl $min $max $dh" >>plot-$k-dev; echo "$x $avg" >>plot-$k-avg
+done
+
+for k in au du; do
+ gnuplot <<EOF
+set xrange [0:10000]
+set terminal postscript eps enhanced
+set output "$k.ps"
+plot "plot-$k-dev" with candlesticks, "plot-$k-avg" with lines;
+EOF
+done
--- /dev/null
+#!/usr/bin/perl
+
+$x = -1;
+$data = {};
+
+while(<>) {
+ if(/^(\d+):/) {
+ if($x != -1) {
+ for $k (keys %$data) {
+ $sum = $num = 0;
+ $min = $max = -1;
+ for $v (@{$data->{$k}}) {
+ $sum += $v;
+ $num++;
+ if(($min == -1) || ($min > $v)) {
+ $min = $v;
+ }
+ if(($max == -1) || ($max < $v)) {
+ $max = $v;
+ }
+ }
+ $avg = $sum / $num;
+ $devsum = 0;
+ for $v (@{$data->{$k}}) {
+ $devsum += ($v - $avg) ** 2;
+ }
+ $dev = sqrt($devsum / $num);
+ $devmin = $avg - $dev;
+ $devmax = $avg + $dev;
+ print "$k $x $avg $dev $devmin $devmax $min $max\n";
+ }
+ }
+ $x = $1;
+ $data = {};
+ } elsif(/(\w+): ([\d.]+)/) {
+ push @{$data->{$1}}, $2;
+ }
+}