frontend/scanner: Simplified handling of reserved words.
store, frontend: Parse object field matchers.
Field names are identified as ":<field-name>" and all conditional operators
are supported to compare them against an expression.
Field names are identified as ":<field-name>" and all conditional operators
are supported to compare them against an expression.
frontend/parser: Added support for time interval values.
time: Added sdb_strpunit() to parse a time unit.
time: Renamed PRIscTIME to PRIsdbTIME.
Another remnant of the “syscollector” days ;-)
Another remnant of the “syscollector” days ;-)
frontend: Let FETCH/LIST/LOOKUP implementations accept filters.
This is in preparation for letting the parser support filters. It's not
actually used yet.
This is in preparation for letting the parser support filters. It's not
actually used yet.
store: Fixed JSON serialization when skipping hosts due to filters.
Previously, it might have happened that a comma was appended to a list of
hosts even though all subsequent hosts were filtered out. This created invalid
JSON. Now, don't let sdb_store_host_tojson ignore hosts entirely. Instead,
always let it serialize the host passed to the function and only pass on the
filter to child objects. The caller is now responsible for calling the filter
and, at the same time, the caller is able to correctly handle skipped hosts.
Fixed the unit-test which should have caught this.
Previously, it might have happened that a comma was appended to a list of
hosts even though all subsequent hosts were filtered out. This created invalid
JSON. Now, don't let sdb_store_host_tojson ignore hosts entirely. Instead,
always let it serialize the host passed to the function and only pass on the
filter to child objects. The caller is now responsible for calling the filter
and, at the same time, the caller is able to correctly handle skipped hosts.
Fixed the unit-test which should have caught this.
store: Let JSON serializers support (object) filters.
Only objects covered by the specified filter will be included in the JSON
output.
Only objects covered by the specified filter will be included in the JSON
output.
liboconfig: Relicensed to MIT license.
Florian Forster relicensed the code in collectd's Git commit
633c3966f770e4d46651a2fe219a18d8a9907a9f.
<https://github.com/collectd/collectd/commit/633c3966f770e4d46651a2fe219a18d8a9907a9f>
Florian Forster relicensed the code in collectd's Git commit
633c3966f770e4d46651a2fe219a18d8a9907a9f.
<https://github.com/collectd/collectd/commit/633c3966f770e4d46651a2fe219a18d8a9907a9f>
store_lookup: Added conditional for accessing store-object fields.
Fields are "last-update", "age", "interval", and "backend".
"backend" only supports the lookup of objects provided by a named backend but
no conditional checks.
Fields are "last-update", "age", "interval", and "backend".
"backend" only supports the lookup of objects provided by a named backend but
no conditional checks.
store_lookup: Make sure to always initialize the buffer in tostring().
store: Make matchers more generic and applicable to non-hosts as well.
Most of the matchers are actually not specific to hosts and may be re-used for
different purposes (e.g. filters). Make them applicable to arbitrary object
types (again) and only check for the right object type when actually needed.
Added simple unit-tests covering filters applied to all types of objects.
Most of the matchers are actually not specific to hosts and may be re-used for
different purposes (e.g. filters). Make them applicable to arbitrary object
types (again) and only check for the right object type when actually needed.
Added simple unit-tests covering filters applied to all types of objects.
store: Introduced the concept of query filters.
A filter may be used to preselect objects when evaluating a query. Any object
that's used during the evaluation of a matcher will be compared against the
filter. Only matching objects will be considered further.
A filter may be used to preselect objects when evaluating a query. Any object
that's used during the evaluation of a matcher will be compared against the
filter. Only matching objects will be considered further.
store, frontend: Let lookups support arbitrary expressions for comparison.
… rather than simple values.
When comparing object names, the expression has to evaluate to a (constant)
string but conditional attribute comparison supports arbitrary expressions.
Expressions are only evaluated when using them during a comparison even though
we only support constant expressions so far. This will be optimized in the
future.
… rather than simple values.
When comparing object names, the expression has to evaluate to a (constant)
string but conditional attribute comparison supports arbitrary expressions.
Expressions are only evaluated when using them during a comparison even though
we only support constant expressions so far. This will be optimized in the
future.
store_lookup: Catch invalid values when parsing a matcher.
Added a unit-test exposing the segfault we would have seen previously.
Added a unit-test exposing the segfault we would have seen previously.
frontend: Added a parser for arithmetic expressions.
For now, the expressions are used in place of a datum but the parser will
actually evaluate the expression before passing it on to the store during
lookup. Since expressions currently cover constant results only, this is not a
limitation for now.
For now, the expressions are used in place of a datum but the parser will
actually evaluate the expression before passing it on to the store during
lookup. Since expressions currently cover constant results only, this is not a
limitation for now.
store_expr: Added framework for arithmetic expressions.
A store expression describes the parse tree of an arithmetic expression and
provides means to execute it (based on sdb_data_expr_eval()).
A store expression describes the parse tree of an arithmetic expression and
provides means to execute it (based on sdb_data_expr_eval()).
data: Added sdb_data_expr_eval().
This function may be used to evaluate simple operation expressions on data
values. Supported operators are +, -, *, /, %, and (for string and binary
values) concatenation.
This function may be used to evaluate simple operation expressions on data
values. Supported operators are +, -, *, /, %, and (for string and binary
values) concatenation.
Merged branch 'master' of git://git.tokkee.org/sysdb.
Conflicts:
src/frontend/grammar.y
Conflicts:
src/frontend/grammar.y
Query language: Changed 'LOOKUP .. WHERE' to 'LOOKUP .. MATCHING'.
'WHERE' was too SQL-like while it has somewhat different semantics. Using a
different keyword will hopefully avoid any confusion.
'WHERE' was too SQL-like while it has somewhat different semantics. Using a
different keyword will hopefully avoid any confusion.
Merged branch 'master' of git://git.tokkee.org/sysdb.
store, frontend: Renamed sdb_store_lookup() to sdb_store_scan().
It does a full scan of the entire store, so lookup sounds a bit euphemistic.
It does a full scan of the entire store, so lookup sounds a bit euphemistic.
Added the SysDB homepage to all manpages.
README: Added links to documentation and "getting help".
Cleaned up nomenclature in the parser.
Replace the generic "expression" with "condition".
Replace the generic "expression" with "condition".
Added upstream homepages to backend manpages.
sysdbql(7): Updated based on latest changes to the query language.
store, frontend: Switch from <obj>.name to <obj>.
This feels a bit more natural and no longer shadows attributes called "name".
This feels a bit more natural and no longer shadows attributes called "name".
store_lookup: Don't allow 'IS <non-NULL>'.
This would have been silently treated as 'IS NULL'.
This would have been silently treated as 'IS NULL'.
sysdb: Fixed a memory leak in an error condition.
Thanks to clang-analyze for identifying this!
Thanks to clang-analyze for identifying this!
valgrind.suppress: Added a leak inside libnss as seen on Travis CI.
test_lib.sh: Let integration tests use valgrind.suppress as well.
store_lookup_test: Added some tests for attribute.FOO IS NULL.
store, frontend: Added support for matching NULL attributes.
This matches any hosts which are missing the specified attribute.
This matches any hosts which are missing the specified attribute.
t/integration/simple_config.sh: Test some more invalid settings.
t/integration/simple_config.sh: Test reconfiguration.
t/integration/simple_config.sh: Run the tools using -h and -V.
t/integration/simple_query.sh: Pass in queries through stdin as well.
This covers some more code.
This covers some more code.
sysdb: Fixed a memory leak on EOF from the server.
sysdb: Use non-callback readline mode when non-interactive.
libedit's implementation of the callback-mode does not play well in
non-interactive mode (e.g. it does not correctly detect EOF) but works fine
when using readline().
Also, there's no need for the somewhat more complex callback mode in
non-interactive operation anyway.
libedit's implementation of the callback-mode does not play well in
non-interactive mode (e.g. it does not correctly detect EOF) but works fine
when using readline().
Also, there's no need for the somewhat more complex callback mode in
non-interactive operation anyway.
plugin: Report an error if a collector's interval cannot be determined.
Else, we'll get weird behavior when, for example, using LoadPlugin instead of
LoadBackend in sysdbd.
Else, we'll get weird behavior when, for example, using LoadPlugin instead of
LoadBackend in sysdbd.
t/coverage.sh: Output the content of t/test-suite.log in case of a failure.
t/testwrapper: Let valgrind generate suppressions for all failures.
These are printed to stdout.
These are printed to stdout.
t/valgrind.suppress: Updated existing suppression for newer check version.
(Keeping the old around for people using the old version of check, e.g.
Travis.)
(Keeping the old around for people using the old version of check, e.g.
Travis.)
t/: Include testwrapper.sh in the distribution tarball.
t/valgrind.suppress: Suppress another error in check.
t/cibuild.sh: Still use TESTS_ENVIRONMENT="./testwrapper.sh".
LOG_COMPILER is not supported by older automake versions.
LOG_COMPILER is not supported by older automake versions.
t/: Always use testwrapper.sh for running tests.
… using automake's LOG_COMPILER variable.
… using automake's LOG_COMPILER variable.
data_test: Fixed access to uninitialized memory.
avltree: Iterate through the tree depth-first when clearing it.
Else, we cannot simple delete each node but we'd have to actually remove it
from the tree because we'd be removing non-leaf nodes.
Don't use recursion for iterating the tree. It's not needed and would
consume stack-space unnecessarily. The current approach limits the size of the
tree by heap memory only.
Else, we cannot simple delete each node but we'd have to actually remove it
from the tree because we'd be removing non-leaf nodes.
Don't use recursion for iterating the tree. It's not needed and would
consume stack-space unnecessarily. The current approach limits the size of the
tree by heap memory only.
store: Use AVL trees to store all objects.
avltree: Always compare objects by name.
We don't need a custom compare function (for now) and correctly passing in a
const string when comparing based on objects is annoying to get right.
We don't need a custom compare function (for now) and correctly passing in a
const string when comparing based on objects is annoying to get right.
avltree: Added documentation for all functions.
avltree: Added sdb_avltree_lookup().
object: Added SDB_OBJECT_STATIC.
This is a helper to initialize static, named objects.
Replaced SSTRING_OBJ (which was basically the same) used by unit tests.
This is a helper to initialize static, named objects.
Replaced SSTRING_OBJ (which was basically the same) used by unit tests.
object: Static wrapper objects cannot have a destructor.
We cannot free the static memory and, thus, cannot destroy the object.
We cannot free the static memory and, thus, cannot destroy the object.
avltree.h: Removed obsolete TODO note.
AVL trees *are* balanced now :-)
AVL trees *are* balanced now :-)
avltree: Added helper function sdb_avltree_valid().
The function walks the entire tree and checks each node for problems (e.g.
unbalanced nodes, wrong height, missing child/parent links).
Use the function in the unit tests (which is the primary use for the function
anyway ;-)).
The function walks the entire tree and checks each node for problems (e.g.
unbalanced nodes, wrong height, missing child/parent links).
Use the function in the unit tests (which is the primary use for the function
anyway ;-)).
error.h: Removed long-unused constant.
avltree: Don't leak memory when clearing the tree.
Remove all nodes starting at the smallest instead of at the root.
Remove all nodes starting at the smallest instead of at the root.
avltree: Added helper to determine smallest node.
avltree: Lock the tree during insertion.
avltree: Rebalance the tree after inserting a new element.
avltree_test: Degenerate (unbalanced) test-tree even more.
avltree: Removed some irrelevant special cases.
sysdb.h: Added helpers to compare two values.
coverage.sh: Ignore *.y / *.l files.
lcov cannot handle them correctly.
lcov cannot handle them correctly.
avltree_test: Test duplicate detection and clear() as well.
utils avltree: Started implementation of an AVL tree.
So far, it's just an unbalanced binary tree, though ;-)
So far, it's just an unbalanced binary tree, though ;-)
Moved compare and lookup callback types from utils/llist to core/object.
Makefile: Install utils/os.h as well.
collectd::unixsock backend: Store plugin identifier as service attributes.
collectd::unixsock backend: Added support for spaces in identifiers.
Don't treat space as a field separator for LISTVAL responses. Instead, split
of the update timestamp from the hostname after splitting at slash characters
only.
Don't treat space as a field separator for LISTVAL responses. Instead, split
of the update timestamp from the hostname after splitting at slash characters
only.
store: Reduce logging about "old" values.
Don't log, if the same timestamp was used to submit the value. This avoids
excessive noise in the logs on high sampling rates.
Don't log, if the same timestamp was used to submit the value. This avoids
excessive noise in the logs on high sampling rates.
unixsock, data: Moved sdb_unixsock_parse_cell() to sdb_data_parse().
The function parses a string into a datum. For date-time values, floating
point seconds since the epoch are supported only.
Added unit tests.
The function parses a string into a datum. For date-time values, floating
point seconds since the epoch are supported only.
Added unit tests.
store: Include service attributes in JSON output.
store: Don't update unchanged attribute values.
When handling dynamically allocated data, this would generate unnecessary
memory churn.
When handling dynamically allocated data, this would generate unnecessary
memory churn.
data: Pass const pointers to sdb_data_cmp().
store: Don't overwrite attribute values if the new timestamp is too old.
Also, extended the unit tests to catch this error.
Also, extended the unit tests to catch this error.
store: Introduced service attributes.
store: Consider objects too old if the new timestamp matches the old.
In theory, this doesn't make a big difference as either approach will let the
result depend on the order of update operations. However, considering more
cases as too old will allow to ignore more stuff and, thus, avoid some work.
In theory, this doesn't make a big difference as either approach will let the
result depend on the order of update operations. However, considering more
cases as too old will allow to ignore more stuff and, thus, avoid some work.
data: Improved memory handling in data_copy().
Ensure that dynamic memory in the destination is freed before copying the new
data. That'll avoid that the caller has to use data_free_datum() first and
destroy previous data even if the copy fails.
Ensure that dynamic memory in the destination is freed before copying the new
data. That'll avoid that the caller has to use data_free_datum() first and
destroy previous data even if the copy fails.
store: Don't destroy an attribute if data_copy() failed.
Else, the store would reference invalid memory.
Else, the store would reference invalid memory.
store: Split internal store_obj() function into multiple functions.
This avoids a couple of unnecessary checks and will allow to reuse some parts.
This avoids a couple of unnecessary checks and will allow to reuse some parts.
version-gen.sh: Added .git suffix to default version again.
Release SysDB 0.2.0.
sysdbql(7): Documented conditional attribute matchers.
ReleaseNotes: Added release 0.2.0.
Merged branch 'master' of git://git.tokkee.org/sysdb.
store: Include backend information in the JSON serialization.
store: Store the backend of each stored object.
The backends are stored as a list of the plugin names of the plugins providing
the respective object.
The backends are stored as a list of the plugin names of the plugins providing
the respective object.
plugin: Added sdb_plugin_current().
This function returns the plugin information for the plugin from which the
current call into the core originated.
This function returns the plugin information for the plugin from which the
current call into the core originated.
plugin: Make sdb_plugin_info_t public.
store: Split out common JSON code into a separate helper function.
Travis: Ignore .y/.l files when running cpp-coveralls.
os_test: Added tests for os_mkdir_all() and os_remove_all().
utils os: Added sdb_remove_all() to recursively remove a path.
connection_test: Use mkstemp() instead of tmpnam().
sock_test: Use mkstemp() instead of tmpnam().
Don't free dirname()'s return value.
It may point to static memory.
It may point to static memory.