Travis: Don't use 'coveralls --verbose'.
coveralls reports work fine now, so we don't need this anymore.
coveralls reports work fine now, so we don't need this anymore.
README: Added links to travis-ci and coveralls.
sysdbd(1): Fixed typo.
Added sysdb(1) manpage and updated sysdb help output.
Travis: Don't use --use-mirrors with pip.
It's been deprecated and I think we don't need it ;-)
It's been deprecated and I think we don't need it ;-)
Travis; Pass --build-root to coveralls.
Else, it cannot find the right source files.
Else, it cannot find the right source files.
Travis: Display information about cpp-coveralls after installing it.
t/coverage.sh: Restore t/cibuild.sh in the temp directory.
This is to avoid the version being marked as dirty.
This is to avoid the version being marked as dirty.
store_lookup_test: Added a more complex parser/lookup test.
store_lookup: Added "tostring" methods for matcher objects.
This is meant for logging and debugging. For now, it's used in tests to check
parsed and compiled matchers.
This is meant for logging and debugging. For now, it's used in tests to check
parsed and compiled matchers.
store_lookup_test: Fixed user-data passed to the lookup callback.
parser: Make sure that each comparator matcher is a host matcher.
So far, 'NOT (service|attribute).<attr> <cmp> <value>' matches did not work
correctly, because the object matcher was not correctly wrapped into a host
matcher. Since we do not currently support querying any object types besides
hosts, this was wrong.
The respective code has been moved into sdb_store_matcher_parse_cmp() which
also implements and checks the restriction on matching host objects only.
A new set of tests has been introduced which exposed this problem and which
(roughly) verifies the result of a lookup using a parsed matcher.
So far, 'NOT (service|attribute).<attr> <cmp> <value>' matches did not work
correctly, because the object matcher was not correctly wrapped into a host
matcher. Since we do not currently support querying any object types besides
hosts, this was wrong.
The respective code has been moved into sdb_store_matcher_parse_cmp() which
also implements and checks the restriction on matching host objects only.
A new set of tests has been introduced which exposed this problem and which
(roughly) verifies the result of a lookup using a parsed matcher.
frontend/parser_test: Cover more basic expressions.
frontend: Actually implement support for the NOT operator.
core, frontend: Added !=, !~, and NOT operators.
store_lookup: Added sdb_store_inv_matcher().
This creates a matcher objects which matches the inverse (logical NOT) of the
specified matcher.
This creates a matcher objects which matches the inverse (logical NOT) of the
specified matcher.
frontend: Let the parser support brackets in matcher expressions.
frontend: Fixed memory holes in the parser.
store: Don't change the interval if the new interval is zero.
If the interval is zero, multiple updates happened at the same time. This does
not affect the interval at which the object is updated in the backend, though.
If the interval is zero, multiple updates happened at the same time. This does
not affect the interval at which the object is updated in the backend, though.
parser_test: Check operator precedence.
parser_test: Check matcher type returned by sdb_fe_parse_matcher().
frontend parser: Added support for AND and OR matchers.
frontend: Updated unit-tests for expression related parsing.
frontend: Accept compare matchers as expressions.
… replacing the current placeholder.
For now, this is specific to '=' (equal) and '=~' (regex) comparison.
… replacing the current placeholder.
For now, this is specific to '=' (equal) and '=~' (regex) comparison.
frontend: Don't ignore single characters in the scanner.
This would lead to those characters be silently ignored at any place in the
input stream.
This would lead to those characters be silently ignored at any place in the
input stream.
store: Added sdb_store_matcher_parse_cmp().
This function parses simple matcher compare expressions (<obj_type>.<attr>
<op> <value>).
This function parses simple matcher compare expressions (<obj_type>.<attr>
<op> <value>).
store: Moved matcher types to store-private.h.
collectd::unixsock backend: Simplified host updates.
Also, don't do duplicate updates in a single iteration. This caused bad
startup effects for the interval calculation.
Later, we should make the core more robust in that respect, I guess.
Also, don't do duplicate updates in a single iteration. This caused bad
startup effects for the interval calculation.
Later, we should make the core more robust in that respect, I guess.
store_test: Added a test for interval calculation.
store: Include update interval in the JSON serialization.
core/time: Added sdb_strfinterval().
This function formats a time interval using the format 1Y2M3D4h5m6.7s.
This function formats a time interval using the format 1Y2M3D4h5m6.7s.
store: Fixed a conversion warning reported by GCC.
store: Calculate and store each objects update interval.
The interval is calculated as the moving average of the incoming update
intervals. This should also work fine for out-of-order updates or updates from
multiple sources.
The interval is calculated as the moving average of the incoming update
intervals. This should also work fine for out-of-order updates or updates from
multiple sources.
frontend: Let LIST not include details.
Now that we have FETCH and LOOKUP, list should only provide basic information
(name and last_update).
Now that we have FETCH and LOOKUP, list should only provide basic information
(name and last_update).
parser_test: Added simple LOOKUP parser tests.
frontend: Added LOOKUP support to the connection handler.
For now, the wire format is: <CONNECTION_LOOKUP>;<len>;<expression>
For now, the wire format is: <CONNECTION_LOOKUP>;<len>;<expression>
frontend: Added simple 'LOOKUP <type> WHERE <expression>' query.
This query command may be used to retrieve a list of detailed host information
for each host matching the specified expression. For now, querying hosts is
supported only.
This query command may be used to retrieve a list of detailed host information
for each host matching the specified expression. For now, querying hosts is
supported only.
store: Let sdb_store_matcher_matches return true if it matches.
Rather than using 0 for matches and -1 else.
Rather than using 0 for matches and -1 else.
store: Added sdb_store_lookup().
This function looks up objects from the store which match a user-specified
matcher. For each such object, a user-specified callback is executed.
This function looks up objects from the store which match a user-specified
matcher. For each such object, a user-specified callback is executed.
store: Added sdb_store_iterate().
This function iterates over all (host, for now) objects in the store and calls
a user-specified callback for each.
This function iterates over all (host, for now) objects in the store and calls
a user-specified callback for each.
grammar.y: Added some (very) short documentation for each statement.
parser_test: Fixed a sign-compare warning/error on GCC.
frontend: Require strings instead of identifiers.
… for host names and name matchers. Identifiers were used as an early
work-around but they are not valid in those places.
… for host names and name matchers. Identifiers were used as an early
work-around but they are not valid in those places.
frontend: Added very simple single-quoted string support.
No escape sequences whatsoever are supported so far but except for that any
single-quoted strings which do not contain single quotes, can be used.
FETCH now supports host names specified as strings as well.
No escape sequences whatsoever are supported so far but except for that any
single-quoted strings which do not contain single quotes, can be used.
FETCH now supports host names specified as strings as well.
frontend: Free dynamically allocated memory in the parser.
frontend: Added FETCH support to the connection handler.
The wire format is: <CONNECTION_FETCH>;<len>;<host>
The wire format is: <CONNECTION_FETCH>;<len>;<host>
parser_test: Check the node's command type.
frontend: Added 'FETCH <name>' query command.
For now, <name> may only be a simple identifier.
For now, <name> may only be a simple identifier.
object: Added sdb_object_create_dT() macro.
This may be used to create a simple dynamic object of a specified type.
Dynamic type means that it uses a destructor.
This may be used to create a simple dynamic object of a specified type.
Dynamic type means that it uses a destructor.
object: Let create_simple() accept an optional destructor.
This is still simple but it allows for some more dynamic.
This is still simple but it allows for some more dynamic.
frontend: Let the parser not accept other grammars in default mode.
utils llist: Let llist_get() increment the reference count.
This feels more consistent.
This feels more consistent.
frontend parser: Added support for parsing single expressions.
The parser has been extended to support different modes. In SDB_PARSE_EXPR
mode, a single expression will be accepted as a start condition. The new
function sdb_fe_parse_matcher() uses this to parse expressions.
For now, this implements only the basic framework. Any identifier will be
parsed as a simple name matcher expression.
The parser has been extended to support different modes. In SDB_PARSE_EXPR
mode, a single expression will be accepted as a start condition. The new
function sdb_fe_parse_matcher() uses this to parse expressions.
For now, this implements only the basic framework. Any identifier will be
parsed as a simple name matcher expression.
t/cibuild.sh: Use ./configure --enable-standards.
configure: Don't use -pedantic.
Else, GCC will complain about "ISO C forbids conversion of object pointer to
function pointer type", even for casting function points to or from void
pointers. This is allowed by POSIX, though, and required, for example, for
dlsym() to work.
Else, GCC will complain about "ISO C forbids conversion of object pointer to
function pointer type", even for casting function points to or from void
pointers. This is allowed by POSIX, though, and required, for example, for
dlsym() to work.
configure: Make "standards" and "hardening" flags part of STRICT_CFLAGS.
Most importantly, don't assign them to CFLAGS which might be overwritten when
running make, thus leaving out the flags which were originally requested to be
used.
Most importantly, don't assign them to CFLAGS which might be overwritten when
running make, thus leaving out the flags which were originally requested to be
used.
configure: Disable -Wsign-conversion.
It may cause problems in expanded macros from libc.
It may cause problems in expanded macros from libc.
configure: Request X/Open 7 (XSI) compliance.
This is required for strndup().
This is required for strndup().
configure: Include _BSD_SOURCE in standards related defines.
Else, GNU libc does not define strcasecmp() even though it conforms to
POSIX.1-2001.
Else, GNU libc does not define strcasecmp() even though it conforms to
POSIX.1-2001.
Removed semicolon from SDB_PLUGIN_MAGIC definition.
Rather, the semicolon is added when using the define.
Rather, the semicolon is added when using the define.
Fixed (pedantic) void-pointer to function-pointer cast warnings.
Include config.h in source files.
Else, we don't get any definitions required for enforcing standard compliance.
Else, we don't get any definitions required for enforcing standard compliance.
frontend: Fixed two typing issues.
frontend, liboconfig: Added missing prototypes for yylex/yyparse.
store_lookup_test: Continue loop after fail().
The compiler does not know that fail aborts the test program and clang
(correctly) complains that the variable ('m' in this case) might be used
uninitialized afterwards.
The compiler does not know that fail aborts the test program and clang
(correctly) complains that the variable ('m' in this case) might be used
uninitialized afterwards.
t/coverage.sh: Fall-back to lcov without --no-external.
Old versions of lcov don't support that flag. Simply try to fall back in case
the first run fails.
Old versions of lcov don't support that flag. Simply try to fall back in case
the first run fails.
store_lookup: Made logical operators public.
Added tests for store lookup functions.
store: Added public functions to create and execute matchers.
The matcher types are now based on sdb_object_t to ease memory management in
case a matcher is used in multiple places. Constructors for each matcher type
are now available and the top-level matching function has been made public.
The matcher types are now based on sdb_object_t to ease memory management in
case a matcher is used in multiple places. Constructors for each matcher type
are now available and the top-level matching function has been made public.
t/coverage.sh: Use version-gen.sh to determine the current version.
… rather than guessing ;-) D'oh!
… rather than guessing ;-) D'oh!
t/coverage.sh: Don't git reset but test the current, possibly dirty, code.
Instead, only get back files which are not included in the tarball.
Instead, only get back files which are not included in the tarball.
store_lookup: Fix matching of services with empty attr matcher.
store: Require name matchers to match string *and* regex if specified.
store: Fixed data format error detection.
store_test: Clear the test after running the test-case.
This removes any cross-dependencies between multiple checks.
This removes any cross-dependencies between multiple checks.
store: Added sdb_store_clear().
This function clears the entire store removing all entries. It's mostly
useful for testing, I suppose.
This function clears the entire store removing all entries. It's mostly
useful for testing, I suppose.
store: Added a frame-work for object lookups.
store_lookup currently provides low-level functionality for matching store
objects based on their various attributes.
store_lookup currently provides low-level functionality for matching store
objects based on their various attributes.
data: Let sdb_data_format() different quoting styles.
data_test: Compare return values of format() and strlen().
This is to check that sdb_data_strlen() reports sane numbers.
This is to check that sdb_data_strlen() reports sane numbers.
data: Let sdb_data_format() return the number of bytes written.
date_test: Added some simple overflow tests.
data: Let sdb_data_format output to a character array.
This is more universally usable.
This is more universally usable.
data: Added sdb_data_strlen.
This function provides a worst-case estimate of the number of bytes required
to format a datum as a string.
This function provides a worst-case estimate of the number of bytes required
to format a datum as a string.
data_test: Print type of datum in case of a test failure.
data_test: Use a table-driven test.
data: Escape \ and " in strings when formatting them.
data: Correctly format NULL values.
store: Split private type definitions into a new header store-private.h.
store: Serialize attribute values using sdb_data_format().
store: Removed sdb_ prefix from private lookup function.
data: Double quote formatted date-times.
JSON does not support time values, thus, we need to treat this is a string.
JSON does not support time values, thus, we need to treat this is a string.
data: Format binary bytes as \xXX rather than \XX.
data: Improve serialization of binary data.
Instead of calling strbuf_append() for each byte, precompute the string in a
simple for-loop and then append the result to the buffer. This basically
inlines a formatter specific to this use-case and, thus, should be must
faster.
Instead of calling strbuf_append() for each byte, precompute the string in a
simple for-loop and then append the result to the buffer. This basically
inlines a formatter specific to this use-case and, thus, should be must
faster.
frontend: Don't send debug logs to the client (for now).
Later, this should be configurable by the client at runtime.
Later, this should be configurable by the client at runtime.
frontend: Send connection-related log messages to the client.
This is done by registering a logging callback which will send all messages
originating from a thread currently handling a connection to the respective
client. For this, the connection object is stored in a thread-specific data
segment.
This is done by registering a logging callback which will send all messages
originating from a thread currently handling a connection to the respective
client. For this, the connection object is stored in a thread-specific data
segment.
sysdb: Handle EOF from the server.
client: Correctly handle EOF in sdb_client_connect().
client: Added an EOF flag to the client object.
In a lot of cases, a client is passed through a couple of functions in order
to handle I/O. Adding the flag will make it easier to access the information
in the right location without having to worry about 0 return codes (which mean
different things in some cases anyway, e.g. in sdb_client_recv() which returns
zero if an empty message (header only) has been received).
In a lot of cases, a client is passed through a couple of functions in order
to handle I/O. Adding the flag will make it easier to access the information
in the right location without having to worry about 0 return codes (which mean
different things in some cases anyway, e.g. in sdb_client_recv() which returns
zero if an empty message (header only) has been received).
frontend/connection: Require authentication before allowing any commands.
frontend/session: Store authenticated user information.
Also, for now, reject access in case no username is provided.
Also, for now, reject access in case no username is provided.