summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4840645)
raw | patch | inline | side by side (parent: 4840645)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 7 Nov 2008 14:07:53 +0000 (14:07 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 7 Nov 2008 14:07:53 +0000 (14:07 +0000) |
values for graphing.
The patch has been mostly rewritten and the following changes have been made:
* high dependency on mysql has been reduced by avoiding the
temporary tables (which was bad for mysql replication)
* The number of executed SQL-Statements for one CDEF has been
reduced to 1 compared to 11 SQLs (including CREATE TEMPORARY
TABLE) - for patch against version 1.2
* All consolidation is done in rrdtool itself (MIN,MAX,AVERAGE)
* Additional consolidation functions are COUNT and SIGMA, which give
information on statistics on a per "time-bin" basis.
* All these consolidation values are always returned as separate
columns, that are returned by RRD and the consolidation function
given as Argument is ignored.
Main reason is that this way there is only one call to rrd_fetcht
and thus the database even if we need to fetch for example min,
avg and max. Compare this to 3 calls in case of different
consolidation functions - and if you want to get SIGMA and COUNT
as well it is still only one call to the backend and the database.
* Some previous existing features have been taken out at the moment
to allow for this reduced set of SQL queries.
o prediction using the values from the last X days at the same
time
o the corresponding sigma calculation
* The idea is to create generic CDEF's that will do the same thing,
but that is also available when using RRD-files (similar to TREND,
but with another scope)
This will get posted as a separate patch.
* Overall performance should be much better and the patch as a whole
simpler.
* The patch also includes modifications to the configuration
infrastructure, to make libdbi support optional.
-- Martin Sperl
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1650 a5681a0c-68f1-0310-ab6d-d61299d08faa
The patch has been mostly rewritten and the following changes have been made:
* high dependency on mysql has been reduced by avoiding the
temporary tables (which was bad for mysql replication)
* The number of executed SQL-Statements for one CDEF has been
reduced to 1 compared to 11 SQLs (including CREATE TEMPORARY
TABLE) - for patch against version 1.2
* All consolidation is done in rrdtool itself (MIN,MAX,AVERAGE)
* Additional consolidation functions are COUNT and SIGMA, which give
information on statistics on a per "time-bin" basis.
* All these consolidation values are always returned as separate
columns, that are returned by RRD and the consolidation function
given as Argument is ignored.
Main reason is that this way there is only one call to rrd_fetcht
and thus the database even if we need to fetch for example min,
avg and max. Compare this to 3 calls in case of different
consolidation functions - and if you want to get SIGMA and COUNT
as well it is still only one call to the backend and the database.
* Some previous existing features have been taken out at the moment
to allow for this reduced set of SQL queries.
o prediction using the values from the last X days at the same
time
o the corresponding sigma calculation
* The idea is to create generic CDEF's that will do the same thing,
but that is also available when using RRD-files (similar to TREND,
but with another scope)
This will get posted as a separate patch.
* Overall performance should be much better and the patch as a whole
simpler.
* The patch also includes modifications to the configuration
infrastructure, to make libdbi support optional.
-- Martin Sperl
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1650 a5681a0c-68f1-0310-ab6d-d61299d08faa
diff --git a/program/CONTRIBUTORS b/program/CONTRIBUTORS
index 9b485a6a5dd148eb9e2300585b284175f8866eea..02b72a76f24f8a1935a1ba841530b5f08459e754 100644 (file)
--- a/program/CONTRIBUTORS
+++ b/program/CONTRIBUTORS
Wolfgang Schrimm <wschrimm with uni-hd.de> xport function
Wrolf Courtney <wrolf with wrolf.net> (HP-UX)
hendrik visage <hvisage with is.co.za>
-Martin Sperl <rrdtool martin.sperl.org> (CDEF prediction functions)
+Martin Sperl <rrdtool martin.sperl.org> (CDEF prediction functions, libdbi)
Philippe Simonet <philippe.simonet with swisscom.ch> (Windows Binaries)
Alexander Lucke (lucke with dns-net.de)
of DNS:NET Internet Services (www.dns-net.de) http://rrdtool.org
diff --git a/program/configure.ac b/program/configure.ac
index f08b4e97be8c369bef0e227197158ccdc2f953c7..224f013d5072ff74b55473576421165aafde39dc 100644 (file)
--- a/program/configure.ac
+++ b/program/configure.ac
CONFIGURE_PART(Find 3rd-Party Libraries)
+AC_ARG_ENABLE(libdbi,[ --disable-libdbi do not build in support for libdbi],[have_libdbi=no],[
+ XXX=$LIBS
+ LIBS="$LIBS -ldbi -ldl"
+ AC_MSG_CHECKING(for libdbi)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <dbi/dbi.h>]],
+ [[dbi_initialize(NULL)]]
+ )
+ ],[AC_DEFINE(HAVE_LIBDBI,[1],[have got libdbi installed])
+ AC_MSG_RESULT([yes])
+ have_libdbi=yes
+ ],[LIBS=$XXX
+ AC_MSG_RESULT([no])
+ have_libdbi=no
+ exit 1
+ ]
+ )
+])
+AM_CONDITIONAL(BUILD_LIBDBI,[test $have_libdbi != no])
AM_CONDITIONAL(BUILD_RRDCGI,[test $enable_rrdcgi != no])
echo " Build rrdcgi: $enable_rrdcgi"
echo " Build librrd MT: $enable_pthread"
echo " Link with libintl: $enable_libintl"
+echo " With libDBI: $have_libdbi"
echo
echo " Libraries: $ALL_LIBS"
echo
index 9c14263c40fdf1e498ad188c2c8df26251425d5d..8913e4add8b117833aab02121d5d74b8d23ca0be 100644 (file)
--- a/program/src/Makefile.am
+++ b/program/src/Makefile.am
fnv.h rrd_graph.h \
rrd_is_thread_safe.h
+if BUILD_LIBDBI
+RRD_C_FILES += rrd_fetch_libdbi.c
+endif
+
if BUILD_GETOPT
noinst_HEADERS += rrd_getopt.h
UPD_C_FILES += rrd_getopt.c rrd_getopt1.c
index d821dfaf89d6b6bf95347fc6de4b126c44a83aa7..83b0cf6fcc584334e0bfa0eb20b2e74615113fa3 100644 (file)
--- a/program/src/rrd_fetch.c
+++ b/program/src/rrd_fetch.c
*start, *end, *step);
#endif
+#ifdef HAVE_LIBDBI
+ /* handle libdbi datasources */
+ if (strncmp("sql",filename,3)==0) {
+ if (filename[3]==filename[4]) {
+ return rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
+ }
+ }
+#endif
+
rrd_init(&rrd);
rrd_file = rrd_open(filename, &rrd, RRD_READONLY);
if (rrd_file == NULL)
diff --git a/program/src/rrd_tool.h b/program/src/rrd_tool.h
index 43781da464783b56d6100a1eef71d9de06fa87c9..f58cd784264fecb93c391aa70a0667beefb9aa08 100644 (file)
--- a/program/src/rrd_tool.h
+++ b/program/src/rrd_tool.h
char ***ds_namv,
rrd_value_t **data);
+
+#ifdef HAVE_LIBDBI
+int rrd_fetch_fn_libdbi(char *filename, enum cf_en cf_idx,
+ time_t *start,time_t *end,
+ unsigned long *step,
+ unsigned long *ds_cnt,
+ char ***ds_namv,
+ rrd_value_t **data);
+#endif
+
#define RRD_READONLY (1<<0)
#define RRD_READWRITE (1<<1)
#define RRD_CREAT (1<<2)