From: Florian Forster Date: Sun, 14 Sep 2008 14:25:08 +0000 (+0200) Subject: Merge branch 'master' into ff/rrdcached X-Git-Tag: collectd-4.6.0~202 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=4765d9e4ae24157cc8772a30fea949b33f5a3e94 Merge branch 'master' into ff/rrdcached Conflicts: src/rrdtool.c --- 4765d9e4ae24157cc8772a30fea949b33f5a3e94 diff --cc configure.in index e1d2e575,80514893..9c54aba1 --- a/configure.in +++ b/configure.in @@@ -2678,9 -2722,7 +2730,8 @@@ AC_PLUGIN([ping], [$with_libopin AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics]) AC_PLUGIN([powerdns], [yes], [PowerDNS statistics]) AC_PLUGIN([processes], [$plugin_processes], [Process statistics]) - AC_PLUGIN([qmail], [yes], [QMail queue statistics]) AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin]) +AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin]) AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics]) AC_PLUGIN([serial], [$plugin_serial], [serial port traffic]) AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin]) @@@ -2847,9 -2890,7 +2899,8 @@@ Configuration postgresql . . . . . $enable_postgresql powerdns . . . . . . $enable_powerdns processes . . . . . . $enable_processes - qmail . . . . . . . . $enable_qmail rrdtool . . . . . . . $enable_rrdtool + rrdcached . . . . . . $enable_rrdcached sensors . . . . . . . $enable_sensors serial . . . . . . . $enable_serial snmp . . . . . . . . $enable_snmp diff --cc src/Makefile.am index 4c0d5c81,f93c5065..4412b3b2 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -569,31 -580,17 +580,27 @@@ if BUILD_PLUGIN_PROCESSE pkglib_LTLIBRARIES += processes.la processes_la_SOURCES = processes.c processes_la_LDFLAGS = -module -avoid-version + processes_la_LIBADD = collectd_LDADD += "-dlopen" processes.la collectd_DEPENDENCIES += processes.la + if BUILD_WITH_LIBKVM_GETPROCS + processes_la_LIBADD += -lkvm endif - - if BUILD_PLUGIN_QMAIL - pkglib_LTLIBRARIES += qmail.la - qmail_la_SOURCES = qmail.c - qmail_la_LDFLAGS = -module -avoid-version - collectd_LDADD += "-dlopen" qmail.la - collectd_DEPENDENCIES += qmail.la endif +if BUILD_PLUGIN_RRDCACHED +pkglib_LTLIBRARIES += rrdcached.la +rrdcached_la_SOURCES = rrdcached.c utils_rrdcreate.c utils_rrdcreate.h +rrdcached_la_LDFLAGS = -module -avoid-version +rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS) +rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS) +collectd_LDADD += "-dlopen" rrdcached.la +collectd_DEPENDENCIES += rrdcached.la +endif + if BUILD_PLUGIN_RRDTOOL pkglib_LTLIBRARIES += rrdtool.la -rrdtool_la_SOURCES = rrdtool.c +rrdtool_la_SOURCES = rrdtool.c utils_rrdcreate.c utils_rrdcreate.h rrdtool_la_LDFLAGS = -module -avoid-version rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS) rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS) diff --cc src/rrdtool.c index 1c4f5dd2,2e1727a8..9b236cb8 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@@ -81,20 -103,12 +83,21 @@@ static int config_keys_num = STATIC_ARR /* If datadir is zero, the daemon's basedir is used. If stepsize or heartbeat * is zero a default, depending on the `interval' member of the value list is * being used. */ --static char *datadir = NULL; -static int stepsize = 0; -static int heartbeat = 0; -static int rrarows = 1200; -static double xff = 0.1; -static double write_rate = 0.0; ++static char *datadir = NULL; ++static double write_rate = 0.0; +static rrdcreate_config_t rrdcreate_config = +{ + /* stepsize = */ 0, + /* heartbeat = */ 0, + /* rrarows = */ 1200, + /* xff = */ 0.1, + + /* timespans = */ NULL, + /* timespans_num = */ 0, + + /* consolidation_functions = */ NULL, + /* consolidation_functions_num = */ 0 +}; /* XXX: If you need to lock both, cache_lock and queue_lock, at the same time, * ALWAYS lock `cache_lock' first! */ @@@ -826,8 -1264,27 +924,27 @@@ static int rrd_config (const char *key "be in the range 0 to 1 (exclusive)."); return (1); } - xff = tmp; + rrdcreate_config.xff = tmp; } + else if (strcasecmp ("WritesPerSecond", key) == 0) + { + double wps = atof (value); + + if (wps < 0.0) + { + fprintf (stderr, "rrdtool: `WritesPerSecond' must be " + "greater than or equal to zero."); + return (1); + } + else if (wps == 0.0) + { + write_rate = 0.0; + } + else + { + write_rate = 1.0 / wps; + } + } else { return (-1); diff --cc src/types.db index 80d6cee2,c8d2f8a1..21d15d64 --- a/src/types.db +++ b/src/types.db @@@ -62,9 -64,9 +64,10 @@@ mysql_threads running:GAUGE:0:U, conne nfs_procedure value:COUNTER:0:4294967295 nginx_connections value:GAUGE:0:U nginx_requests value:COUNTER:0:134217728 +operations value:COUNTER:0:4294967295 percent percent:GAUGE:0:100.1 pg_blks value:COUNTER:0:U + pg_db_size value:GAUGE:0:U pg_n_tup_c value:COUNTER:0:U pg_n_tup_g value:GAUGE:0:U pg_numbackends value:GAUGE:0:U