From 43576b330db3c4e4dafb93703e28595f1417b337 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 26 Oct 2006 22:26:31 +0000 Subject: [PATCH] added perftest tool git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@918 a5681a0c-68f1-0310-ab6d-d61299d08faa --- configure.ac | 1 + examples/Makefile.am | 2 +- examples/perftest.pl.in | 152 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100755 examples/perftest.pl.in diff --git a/configure.ac b/configure.ac index a39cd8d..ebd0df8 100644 --- a/configure.ac +++ b/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/examples/Makefile.am b/examples/Makefile.am index 921249b..6a108d3 100644 --- a/examples/Makefile.am +++ b/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/examples/perftest.pl.in b/examples/perftest.pl.in new file mode 100755 index 0000000..f7907c2 --- /dev/null +++ b/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 <