[collectd-changes] collectd, the system statistics collection daemon: Changes to 'master'
Florian Forster
octo at verplant.org
Sat Nov 17 09:39:43 CET 2012
contrib/postgresql/collectd_insert.sql | 234 ++++++++++++
src/collectd.conf.pod | 142 ++++++-
src/postgresql.c | 641 +++++++++++++++++++++++++++++++-
src/utils_time.c | 35 ++
src/utils_time.h | 6 +
5 files changed, 1036 insertions(+), 22 deletions(-)
New commits:
commit 5131a49ad0584aa22282aacf72b6e4ca75356bae
Merge: d6d4281 9a84a66
Author: Florian Forster <octo at collectd.org>
Date: Sat Nov 17 09:39:33 2012 +0100
Merge branch 'sh/postgresql-writer'
Conflicts:
src/collectd.conf.pod
src/postgresql.c
commit 9a84a669c98b90fad45d943b56d5d3f3b3ba8c97
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 15:14:45 2012 +0100
collectd_insert.sql: Use timestamptz rather than timestamp.
Don't want to get messed-up values after daylight-savings changes.
commit 25e9d1cb2d4fd2908b48640997e0922888ec5d8e
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 15:14:10 2012 +0100
utils_time: cdtime_to_iso8601(): Include timezone information as well.
commit aabd019de0a1bd837ec770bc53ef9433cb136c12
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 13:42:29 2012 +0100
postgresql plugin: Simplified transaction handling a bit.
Don't set any next commit time after committing a transaction but only when
starting a new transaction. This way, db->next_commit == 0 always means that
we're outside of a transaction. Also, this removes the need to restart a
transaction right away. Rather, the write callback will take care of that the
next time it gets any data.
commit 30985afc0acb34ccd92a818b42468ef8be4a8151
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 13:36:52 2012 +0100
collectd.conf(5): Documented the postgresql FLUSH support.
commit 27b225794cf5774bc1c34ad431bbabd2cc3971b9
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 13:29:20 2012 +0100
postgresql plugin: Added support for "flushing" data.
This may be used to commit a PostgreSQL writer's transaction. Two different
types of flush callbacks are registered:
- postgresql: Flush *all* databases.
- postgresql-<database>: Flush the database named '<database>' only.
commit 714ecdcf146a04fd0af331aaa67bad1b19cbce3a
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 10:04:46 2012 +0100
postgresql plugin: Fixed unregistering of write callbacks.
Rather than unregistering some callback for each writer for each database,
unregister the single callback for each database only.
commit 61541f6a451a6a6006542ea05eb97cc163bac4c1
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Nov 15 07:43:02 2012 +0100
postgresql plugin: Unregister all writers on shutdown.
This will make sure that all pending transactions will be committed. Else, the
open transactions would be rolled back by the PostgreSQL backend when closing
the connection.
In order to do so, all database connections are now stored in a plugin-global
array (this will also make further changes possible). Also, a ref-count has
been added to the database object in order to support "deleting" an object
twice when having it in use by a connection doing queries and writes.
commit 18a362183d43f2b539cf7687769c2c771070aa75
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 21:11:36 2012 +0100
postgresql plugin: Commit a transaction before shutting down a connection.
Also, make sure to acquire the database lock before that in order to wait for,
for example, outstanding writers.
commit adda7be62dd6ba9e4939d1a65f84ac055416266b
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 21:08:42 2012 +0100
postgresql plugin: Don't try to restart a failed transaction when there's none.
commit f1afdb3de66275f48ca99ec57dafe4ac8b52bf97
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 20:05:33 2012 +0100
postgresql plugin: Restart a writer transaction if the writer's query failed.
The failed query inside the transaction causes the transaction to be aborted
and all subsequent queries to fail as well.
commit f2ac9449d37058bf95be5ce6bfd6679ed4da7c50
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 19:58:25 2012 +0100
collectd.conf(5): Documented the postgresql <Database> 'Writer' option.
commit 4a9d11514a7e95d89dafc3f7f5f4610e707ae9e3
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 19:51:41 2012 +0100
collectd.conf(5): Documented the "CommitInterval" option of 'postgresql'.
commit dbb9598a52ed065012feebf1b58a1e18a4a21f78
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Nov 14 19:36:00 2012 +0100
collectd_insert.sql: Let values_update_childs() return table names.
The function will now return a set of the names of child tables that have been
created.
commit ad0244784f7a9bb3a4ebbb992401a16b0c75a1b6
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Oct 25 12:37:02 2012 +0200
collectd_insert.sql: Added view 'collectd'.
This view provides a join of the 'identifiers' and 'values' tables plus an
additional column with the serialized collectd identifier.
commit 54a5ed57aa80b0214040a537d22b4d116119c546
Author: Sebastian Harl <sh at tokkee.org>
Date: Thu Oct 25 11:00:09 2012 +0200
postgresql plugin: Added 'CommitInterval' config option.
If specified, this option causes a writer to put several updates into a single
transaction. This transaction will last for the specified amount of time (in
seconds). By default, each update would be executed in a separate transaction
causing quite some overhead.
commit d96ebc8e6138a7ddf31401aa402bf835b614f3c6
Author: Sebastian Harl <sh at tokkee.org>
Date: Wed Oct 24 18:33:28 2012 +0200
postgresql plugin: Fixed config key check for <Writer> block.
A missing "else" caused incorrect âIgnoring unknown config key "Statement"â
warning messages.
commit 781f1ec75d243cacf1e0b3d9232e1f74cebaeee0
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 21:48:21 2012 +0200
postgresql plugin: Updated copyright information.
commit fb21b66983a3f8303eb33dd5d2436922dffff6bb
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 21:44:35 2012 +0200
contrib/postgresql/collectd_insert.sql: Added values_update_childs().
This function may be used to create the child tables (for the "values" table)
for the next couple of days (if they don't exist already).
commit 6cade15a8c7847e5f3e314a1f001c6f1576ceea5
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 21:43:42 2012 +0200
postgresql plugin: Fixed a possibly uninitialized variable warning.
This was identified by 'gcc -O2'.
commit e0d76f0aa2258b01a85f32b7bb3e0f0f2342c537
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 14:25:41 2012 +0200
contrib/postgresql/collectd_insert.sql: Added sample writer setup.
commit 6813fcc6b2fa76e47668fc7e70d2a99ad4d327ca
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 14:14:03 2012 +0200
postgresql plugin: Pass an array of data-source types to writers.
The array includes the stringified version of the data-source type, i.e.,
'gauge', 'counter', etc. This will enable the writer to treat different types
differently. However, when having 'StoreRates' enabled (the default) all types
will be 'gauge'. So, in most cases, this won't be used but it has been added
for completeness and to be safe for the future.
commit f4fc8f7c74f2071e02ed40722e044bb8f92aa8d4
Author: Sebastian Harl <sh at tokkee.org>
Date: Sun Aug 19 12:38:21 2012 +0200
postgresql plugin: Added 'StoreRates' feature to writers.
Similar to other write plugins, this option causes counter values to be
converted to rates before submitting them to the database. The option defaults
to true.
commit 0a1424bcab7d7e8d4d99d5e317fbe31fefd5de8f
Author: Sebastian Harl <sh at tokkee.org>
Date: Sat Aug 18 18:12:43 2012 +0200
postgresql plugin: Format time in ISO 8601 format when writing data.
This way, the value may directly be used as a timestamp value in PostgreSQL.
commit 29e1b81ce4bad922c523fcfdfda99c58aafa1af2
Author: Sebastian Harl <sh at tokkee.org>
Date: Sat Aug 18 18:11:39 2012 +0200
utils_time: Added cdtime_to_iso8601() function.
This function formats a cdtime_t value in ISO 8601 format (and ensures that
the string is null terminated).
commit 893f2b75eb8c0cedc1e665b69f9ccc1b7e82a874
Author: Sebastian Harl <sh at tokkee.org>
Date: Sat Aug 18 17:23:42 2012 +0200
postgresql plugin: Added generic support for writing values to a database.
This has been implemented by requiring the user to specify an SQL statement to
be used for storing a value-list in PostgreSQL. Usually, this should be done
by creating custom functions to take care of that.
The user specified statement will then be called by collectd with eight
arguments: time, host, plugin, plugin instance (or NULL), type, type instance
(or NULL), array of value names (data source names) and an array of the
values.
Two elements have been added to the config parser: A <Writer> block may be
used to name an SQL statement (specified using the 'Statement' option) to be
used for writing data. In a <Database> block, the new option 'Writer' may be
used to apply a writer to a database connection.
The current approach has two benefits: for one, a user may chose whatever
database layout best suits her needs. Also, it is very easy to experiment with
different approaches on how to structure the data in a database without the
need to modify the plugin. This can be done in SQL, which (hopefully) is the
language that people working with PostgreSQL databases like most ;-)
If it happens to turn out that some approach is rather superior, it may still
be re-implemented in a specific plugin in later versions.
More information about the collectd-changes
mailing list