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/program@1650
a5681a0c-68f1-0310-ab6d-
d61299d08faa
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
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
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
*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)
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)