collectd.conf(5): Documented the "CommitInterval" option of 'postgresql'.
[collectd.git] / src / collectd.conf.pod
index 7d287cc..29a1d14 100644 (file)
@@ -3487,7 +3487,8 @@ L<http://www.postgresql.org/docs/manuals/>.
     </Query>
 
     <Writer sqlstore>
-      Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8);"
+      Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);"
+      StoreRates true
     </Writer>
 
     <Database foo>
@@ -3510,6 +3511,7 @@ L<http://www.postgresql.org/docs/manuals/>.
     <Database qux>
       # ...
       Writer sqlstore
+      CommitInterval 10
     </Database>
   </Plugin>
 
@@ -3686,8 +3688,8 @@ This mandatory option specifies the SQL statement that will be executed for
 each submitted value. A single SQL statement is allowed only. Anything after
 the first semicolon will be ignored.
 
-Eight parameters will be passed to the statement and should be specified as
-tokens B<$1>, B<$2>, through B<$8> in the statement string. The following
+Nine parameters will be passed to the statement and should be specified as
+tokens B<$1>, B<$2>, through B<$9> in the statement string. The following
 values are made available through those parameters:
 
 =over 4
@@ -3725,6 +3727,13 @@ sources of the submitted value-list).
 
 =item B<$8>
 
+An array of types for the submitted values (i.E<nbsp>e., the type of the data
+sources of the submitted value-list; C<counter>, C<gauge>, ...). Note, that if
+B<StoreRates> is enabled (which is the default, see below), all types will be
+C<gauge>.
+
+=item B<$9>
+
 An array of the submitted values. The dimensions of the value name and value
 arrays match.
 
@@ -3735,6 +3744,12 @@ PostgreSQL database for this purpose. Any procedural language supported by
 PostgreSQL will do (see chapter "Server Programming" in the PostgreSQL manual
 for details).
 
+=item B<StoreRates> B<false>|B<true>
+
+If set to B<true> (the default), convert counter values to rates. If set to
+B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
+number.
+
 =back
 
 The B<Database> block defines one PostgreSQL database for which to collect
@@ -3752,6 +3767,17 @@ for details.
 Specify the interval with which the database should be queried. The default is
 to use the global B<Interval> setting.
 
+=item B<CommitInterval> I<seconds>
+
+This option may be used for database connections which have "writers" assigned
+(see above). If specified, it causes a writer to put several updates into a
+single transaction. This transaction will last for the specified amount of
+time. By default, each update will be executed in a separate transaction. Each
+transaction generates a fair amount of overhead which can, thus, be reduced by
+activating this option. The draw-back is, that data covering the specified
+amount of time will be lost, for example, if a single statement within the
+transaction fails or if the database server crashes.
+
 =item B<Host> I<hostname>
 
 Specify the hostname or IP of the PostgreSQL server to connect to. If the