From: oetiker Date: Thu, 26 Oct 2006 22:26:31 +0000 (+0000) Subject: added perftest tool X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dd8f08751e8e8629725f66df5581f2b4db349fe8;p=rrdtool-all.git added perftest tool git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@918 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/configure.ac b/program/configure.ac index a39cd8dc..ebd0df8f 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -602,6 +602,7 @@ AC_CONFIG_FILES([examples/stripes.pl]) AC_CONFIG_FILES([examples/bigtops.pl]) AC_CONFIG_FILES([examples/minmax.pl]) AC_CONFIG_FILES([examples/4charts.pl]) +AC_CONFIG_FILES([examples/perftest.pl]) AC_CONFIG_FILES([examples/Makefile]) AC_CONFIG_FILES([doc/Makefile]) AC_CONFIG_FILES([src/Makefile]) diff --git a/program/examples/Makefile.am b/program/examples/Makefile.am index 921249be..6a108d34 100644 --- a/program/examples/Makefile.am +++ b/program/examples/Makefile.am @@ -8,7 +8,7 @@ EXTRA_DIST = cgi-demo.cgi.in examplesdir = $(pkgdatadir)/examples examples_SCRIPTS = cgi-demo.cgi piped-demo.pl shared-demo.pl \ - stripes.pl bigtops.pl minmax.pl 4charts.pl + stripes.pl bigtops.pl minmax.pl 4charts.pl perftest.pl cgi-demo.cgi: cgi-demo.cgi.in $(top_builddir)/config.status sed 's,@''exec_prefix@,$(exec_prefix),' $< > $@ diff --git a/program/examples/perftest.pl.in b/program/examples/perftest.pl.in new file mode 100755 index 00000000..f7907c25 --- /dev/null +++ b/program/examples/perftest.pl.in @@ -0,0 +1,152 @@ +#! @PERL@ +# +# $Id:$ +# +# Created By Tobi Oetiker +# Date 2006-10-27 +# +#makes programm work AFTER install + +use lib qw( @prefix@/lib/perl ); + +print < 5; # stop testing after 5 seconds or one round + } + my $ups = $count/$sum; + my $sdv = stddev($sum,$squaresum,$count); + printf STDERR " Update %6d rrds %6d u/s (%6.5f sdv)\n",$totaldbs,$ups,$sdv; + + if ((not $prevups or $prevups / $ups < 2 or $totaldbs < 500 )and $over < 1){ + $totaldbs *= 2; + } elsif ( $over < 1 ) { + # just run another round to see if we realy hit the block + $over ++; + $totaldbs *= 1.3; + } else { + print <