Merge branch 'master' into ff/rrdcached
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 14 Sep 2008 14:25:08 +0000 (16:25 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 14 Sep 2008 14:25:08 +0000 (16:25 +0200)
Conflicts:

src/rrdtool.c

1  2 
configure.in
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod
src/rrdtool.c
src/types.db

diff --cc 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
@@@ -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)
Simple merge
Simple merge
diff --cc 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
@@@ -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