Code

sysdb.git
10 years agoutils strbuf: Added 'min_size' to be considered when shrinking the buffer.
Sebastian Harl [Wed, 17 Sep 2014 09:10:13 +0000 (11:10 +0200)]
utils strbuf: Added 'min_size' to be considered when shrinking the buffer.

It's set to the initial size of the buffer (or 64). The idea is that the
initial size should provide an estimate of a reasonable size and shrinking the
buffer below that size causes unecessary churn.

For example, this is important for the frontend's command handlers which
usually need a large buffer size but initial writes to the buffer may be
small.

10 years agoutils strbuf: Renamed buffer variables from 'strbuf' to 'buf'.
Sebastian Harl [Wed, 17 Sep 2014 09:01:11 +0000 (11:01 +0200)]
utils strbuf: Renamed buffer variables from 'strbuf' to 'buf'.

10 years agofrontend, sysdb: Correctly handle empty queries.
Sebastian Harl [Tue, 16 Sep 2014 17:36:23 +0000 (19:36 +0200)]
frontend, sysdb: Correctly handle empty queries.

Let the frontend send back a DATA message even on empty queries to make sure
the client sees the expected reply.

Let sysdb handle empty replies correctly and also not print any errors on
empty replies (successful command not returning any data).

10 years agofrontend/proto: Include the log priority in LOG messages.
Sebastian Harl [Tue, 16 Sep 2014 16:48:57 +0000 (18:48 +0200)]
frontend/proto: Include the log priority in LOG messages.

The priority is encoded as 32 bit integer in network byte order and added as a
separate field before the actual log message.

The 'sysdb' client now handles LOG messages accordingly and prefixes the
message with a string describing the priority.

10 years agofrontend/proto: Let CONNECTION_DATA not replace CONNECTION_ERROR.
Sebastian Harl [Mon, 15 Sep 2014 17:44:13 +0000 (19:44 +0200)]
frontend/proto: Let CONNECTION_DATA not replace CONNECTION_ERROR.

Instead, reserve some space for groups of status/state codes and then use a
new number / block for CONNECTION_DATA.

10 years agofrontend, proto: Include the response data type in query replies.
Sebastian Harl [Sun, 14 Sep 2014 10:14:48 +0000 (12:14 +0200)]
frontend, proto: Include the response data type in query replies.

For that purpose, use the newly added CONNECTION_DATA status instead of
CONNECTION_OK for query replies and include the data type as the first field
in the message body. The type is the same as the respective command type.

10 years agostrbuf utils: Clarified handling of binary data.
Sebastian Harl [Sun, 14 Sep 2014 10:13:41 +0000 (12:13 +0200)]
strbuf utils: Clarified handling of binary data.

10 years agoproto: Fixed/clarified authentication handshake options during startup.
Sebastian Harl [Sun, 14 Sep 2014 09:23:39 +0000 (11:23 +0200)]
proto: Fixed/clarified authentication handshake options during startup.

The server may request further authentication information from the client
before sending an OK status.

10 years agoReleaseNotes: Added some notes about compatibility.
Sebastian Harl [Sun, 14 Sep 2014 09:10:56 +0000 (11:10 +0200)]
ReleaseNotes: Added some notes about compatibility.

That is, mention that there are no compatibility guarantees at the moment (pre
1.0 versions).

10 years agofrontend: Guarantee that no async messages are sent before startup finished.
Sebastian Harl [Thu, 11 Sep 2014 06:48:40 +0000 (08:48 +0200)]
frontend: Guarantee that no async messages are sent before startup finished.

10 years agoversion-gen.sh: Added .git suffix to default version again.
Sebastian Harl [Mon, 1 Sep 2014 19:33:18 +0000 (21:33 +0200)]
version-gen.sh: Added .git suffix to default version again.

10 years agoRelease SysDB 0.4.0. sysdb-0.4.0
Sebastian Harl [Mon, 1 Sep 2014 18:41:10 +0000 (20:41 +0200)]
Release SysDB 0.4.0.

10 years agoReleaseNotes: Added 0.4.0 release.
Sebastian Harl [Mon, 1 Sep 2014 18:36:22 +0000 (20:36 +0200)]
ReleaseNotes: Added 0.4.0 release.

10 years agoSwitched all sysdb.io links to https://
Sebastian Harl [Mon, 1 Sep 2014 16:21:37 +0000 (18:21 +0200)]
Switched all sysdb.io links to https://

10 years agosysdb(7): Documented basic concepts in more detail.
Sebastian Harl [Mon, 1 Sep 2014 15:49:58 +0000 (17:49 +0200)]
sysdb(7): Documented basic concepts in more detail.

Added more in-depth documentation and examples for hosts/services, how
hostname canonicalization works, and how to use metrics and time-series.

10 years agoconfigure: Make plugin related options more consistent.
Sebastian Harl [Fri, 29 Aug 2014 08:55:18 +0000 (10:55 +0200)]
configure: Make plugin related options more consistent.

That is, use the full plugin names (except "backend" prefixes) for the
--enable-* options.

10 years agocollectd::unixsock: Support 'rrdcached' metrics as well.
Sebastian Harl [Fri, 29 Aug 2014 07:55:34 +0000 (09:55 +0200)]
collectd::unixsock: Support 'rrdcached' metrics as well.

It's the same as 'rrdtool' :-)

10 years agotimeseries::rrdtool: Added support for RRDCacheD.
Sebastian Harl [Thu, 28 Aug 2014 23:42:34 +0000 (16:42 -0700)]
timeseries::rrdtool: Added support for RRDCacheD.

After enabling RRDCacheD support, the plugin supports an additional
time-series fetcher callback which may be used to flush outstanding updates to
an RRD file before fetching data from it.

10 years agodoc/: Improved documentation around the rrdtool time-series fetcher.
Sebastian Harl [Thu, 28 Aug 2014 21:33:06 +0000 (14:33 -0700)]
doc/: Improved documentation around the rrdtool time-series fetcher.

10 years agosysdbql(7): Documented supported data types.
Sebastian Harl [Sat, 23 Aug 2014 05:21:47 +0000 (22:21 -0700)]
sysdbql(7): Documented supported data types.

10 years agofrontend: Added support for single quotes in string constants.
Sebastian Harl [Sat, 23 Aug 2014 04:39:22 +0000 (21:39 -0700)]
frontend: Added support for single quotes in string constants.

Just like in SQL, single quotes may be included in a string by specifying two
adjacent single quotes.

10 years agoAdded __attribute__((format(printf, ...))) where appropriate.
Sebastian Harl [Fri, 22 Aug 2014 06:06:04 +0000 (23:06 -0700)]
Added __attribute__((format(printf, ...))) where appropriate.

Also, fixed various (mostly minor) issues identified this way.

10 years agoplugin: Added missing argument to sdb_log() call.
Sebastian Harl [Fri, 22 Aug 2014 05:17:23 +0000 (22:17 -0700)]
plugin: Added missing argument to sdb_log() call.

10 years agosysdbql(7): Documented the ‘TIMESERIES’ command.
Sebastian Harl [Fri, 22 Aug 2014 05:01:13 +0000 (22:01 -0700)]
sysdbql(7): Documented the ‘TIMESERIES’ command.

10 years agosysdbd-collectd-unixsock(5): Documented the new 'Timeseries' options.
Sebastian Harl [Fri, 22 Aug 2014 04:55:55 +0000 (21:55 -0700)]
sysdbd-collectd-unixsock(5): Documented the new 'Timeseries' options.

10 years agoAdded documentation for the new timeseries::rrdtool plugin.
Sebastian Harl [Fri, 22 Aug 2014 04:55:35 +0000 (21:55 -0700)]
Added documentation for the new timeseries::rrdtool plugin.

10 years agoREADME: Mention the support for metrics and time-series.
Sebastian Harl [Fri, 22 Aug 2014 04:44:27 +0000 (21:44 -0700)]
README: Mention the support for metrics and time-series.

10 years agosysdb-description.txt: Mention the support for metrics and time-series.
Sebastian Harl [Fri, 22 Aug 2014 04:41:43 +0000 (21:41 -0700)]
sysdb-description.txt: Mention the support for metrics and time-series.

10 years agotimeseries: Free the actual time-series object itself as well.
Sebastian Harl [Thu, 21 Aug 2014 05:18:36 +0000 (22:18 -0700)]
timeseries: Free the actual time-series object itself as well.

10 years agocollectd::unixsock: Report an error if TimeseriesBackend != rrdtool.
Sebastian Harl [Thu, 21 Aug 2014 05:10:05 +0000 (22:10 -0700)]
collectd::unixsock: Report an error if TimeseriesBackend != rrdtool.

No other backends are supported yet by the plugin. Support for other types
will require different metric store ID generation.

10 years agocollectd::unixsock: Record the, configurable, time-series store.
Sebastian Harl [Thu, 21 Aug 2014 05:03:42 +0000 (22:03 -0700)]
collectd::unixsock: Record the, configurable, time-series store.

The new config options 'TimeseriesBackend' and 'TimeseriesBaseURL' may be used
to configure the backend store to be used for fetching time-series data for
collectd metrics.

10 years agotimeseries::rrdtool: Added a plugin to fetch time-series from RRD files.
Sebastian Harl [Thu, 21 Aug 2014 03:19:47 +0000 (20:19 -0700)]
timeseries::rrdtool: Added a plugin to fetch time-series from RRD files.

Obviously, the plugin requires librrd. The configure script checks for librrd
using pkg-config.

10 years agotimeseries: Added sdb_timeseries_create().
Sebastian Harl [Thu, 21 Aug 2014 03:17:05 +0000 (20:17 -0700)]
timeseries: Added sdb_timeseries_create().

This function allocates a time-series object and pre-allocates the data array
based on size information passed to the function. All memory is initialized to
zero (except for the length information) such that the object contains valid
(but mostly useless) information.

10 years agotimeseries: Fixed timeseries_destroy().
Sebastian Harl [Thu, 21 Aug 2014 03:15:40 +0000 (20:15 -0700)]
timeseries: Fixed timeseries_destroy().

Correctly access all information indexed by data_names_len and make sure not
to access array members if the array is NULL.

10 years agostore: Fixed JSON-serialization of time-series data.
Sebastian Harl [Thu, 21 Aug 2014 03:12:58 +0000 (20:12 -0700)]
store: Fixed JSON-serialization of time-series data.

Typos caused the end-time and all values to be treated incorrectly.

10 years agoMoved backends from src/backend/ to src/plugins/backend/.
Sebastian Harl [Tue, 19 Aug 2014 03:31:00 +0000 (20:31 -0700)]
Moved backends from src/backend/ to src/plugins/backend/.

10 years agocollectd::unixsock: Store metrics instead of services.
Sebastian Harl [Sat, 16 Aug 2014 19:47:00 +0000 (12:47 -0700)]
collectd::unixsock: Store metrics instead of services.

10 years agointegration/simple_query.sh: Test another failure mode.
Sebastian Harl [Sat, 16 Aug 2014 19:43:17 +0000 (12:43 -0700)]
integration/simple_query.sh: Test another failure mode.

10 years agofrontend: Let CONNECTION_QUERY support 'TIMESERIES' queries.
Sebastian Harl [Sat, 16 Aug 2014 19:38:21 +0000 (21:38 +0200)]
frontend: Let CONNECTION_QUERY support 'TIMESERIES' queries.

10 years agofrontend/parser: Added support for the 'TIMESERIES' command.
Sebastian Harl [Sat, 16 Aug 2014 19:12:05 +0000 (21:12 +0200)]
frontend/parser: Added support for the 'TIMESERIES' command.

Syntax is: TIMESERIES <host>.<metric> [START <datetime>] [END <datetime>]

10 years agostore: Added sdb_store_fetch_timeseries().
Sebastian Harl [Sat, 16 Aug 2014 17:11:45 +0000 (19:11 +0200)]
store: Added sdb_store_fetch_timeseries().

The function fetches a time-series for a specified host's metric and
serializes it into a JSON buffer.

10 years agotimeseries: Added 'data_names_len' field.
Sebastian Harl [Sat, 16 Aug 2014 17:10:51 +0000 (19:10 +0200)]
timeseries: Added 'data_names_len' field.

Else, a user cannot tell how many different sequences are stored in a
data-series.

10 years agotimeseries: Added sdb_timeseries_destroy().
Sebastian Harl [Sat, 16 Aug 2014 17:10:06 +0000 (19:10 +0200)]
timeseries: Added sdb_timeseries_destroy().

10 years agoplugin: Added sdb_plugin_fetch_timeseries().
Sebastian Harl [Sat, 16 Aug 2014 16:14:06 +0000 (18:14 +0200)]
plugin: Added sdb_plugin_fetch_timeseries().

This function fetches a time-series from a named backend data-store using a
previously registered "time-series fetcher" callback.

10 years agocore: Introduced the concept of time-series.
Sebastian Harl [Sat, 16 Aug 2014 10:17:15 +0000 (12:17 +0200)]
core: Introduced the concept of time-series.

A timeseries describes one or multiple sequences of data-points where each
data-point is a timestamp and a value.

A new type of plugin, "time-series fetchers", has been introduced to access
time-series information from arbitrary data-stores.

10 years agostore: Store "data-store" information alongside metrics.
Sebastian Harl [Sat, 16 Aug 2014 10:08:16 +0000 (12:08 +0200)]
store: Store "data-store" information alongside metrics.

A metric data-store describes how to access data (e.g. time-series) of a
metric.

10 years agostore.h: Removed very outdated comments in the documentation.
Sebastian Harl [Sat, 16 Aug 2014 06:38:32 +0000 (08:38 +0200)]
store.h: Removed very outdated comments in the documentation.

10 years agoREADME: Updated Travis-CI and coveralls links.
Sebastian Harl [Sun, 3 Aug 2014 21:26:30 +0000 (23:26 +0200)]
README: Updated Travis-CI and coveralls links.

The main repo has been moved from tokkee/sysdb to sysdb/sysdb.

10 years agointegration tests: Added simple tests for service and metric queries.
Sebastian Harl [Sun, 3 Aug 2014 20:34:14 +0000 (22:34 +0200)]
integration tests: Added simple tests for service and metric queries.

To make that work, let the mock_plugin store some metrics as well.

10 years agostore_lookup_test: Added various tests for metrics.
Sebastian Harl [Sun, 3 Aug 2014 20:16:30 +0000 (22:16 +0200)]
store_lookup_test: Added various tests for metrics.

10 years agostore: Added support for storing metric objects.
Sebastian Harl [Sat, 2 Aug 2014 22:39:20 +0000 (00:39 +0200)]
store: Added support for storing metric objects.

10 years agostore: Added core support for “metrics” objects.
Sebastian Harl [Sat, 2 Aug 2014 22:07:29 +0000 (00:07 +0200)]
store: Added core support for “metrics” objects.

This is going to be used to store information about available metrics (in the
broadest sense). A metric is any kind of queryable value like performance
data.

10 years agosysdbql(7): Updated documentation to keep up with the latest changes.
Sebastian Harl [Sat, 2 Aug 2014 21:22:57 +0000 (23:22 +0200)]
sysdbql(7): Updated documentation to keep up with the latest changes.

10 years agofrontend/grammar: Changes ‘FETCH 'name'’ to ‘FETCH host 'name'’.
Sebastian Harl [Sat, 2 Aug 2014 21:05:44 +0000 (23:05 +0200)]
frontend/grammar: Changes ‘FETCH 'name'’ to ‘FETCH host 'name'’.

This also seems more consistent.

10 years agofrontend/grammar: Changed ‘LIST …’ to ‘LIST hosts …’.
Sebastian Harl [Sat, 2 Aug 2014 20:52:25 +0000 (22:52 +0200)]
frontend/grammar: Changed ‘LIST …’ to ‘LIST hosts …’.

This seems more consistent.

10 years agofrontend/parser: Let ‘LIST’ and ‘FETCH’ accept optional filters as well.
Sebastian Harl [Sat, 2 Aug 2014 20:16:59 +0000 (22:16 +0200)]
frontend/parser: Let ‘LIST’ and ‘FETCH’ accept optional filters as well.

This allows for more consistent results across different types of queries.

10 years agofrontend/parser: Simplified handling of MATCHING and FILTER clauses.
Sebastian Harl [Sat, 2 Aug 2014 19:51:13 +0000 (21:51 +0200)]
frontend/parser: Simplified handling of MATCHING and FILTER clauses.

Make LOOKUP MATCHING clauses optional.

10 years agofrontend/proto.h: Documented the current frontend protocol.
Sebastian Harl [Sat, 2 Aug 2014 19:30:00 +0000 (21:30 +0200)]
frontend/proto.h: Documented the current frontend protocol.

10 years agofrontend: Let sdb_fe_<cmd> check the current command.
Sebastian Harl [Sat, 2 Aug 2014 18:20:16 +0000 (20:20 +0200)]
frontend: Let sdb_fe_<cmd> check the current command.

Now that the code is no longer internal-only, we'll have to be a bit careful
about what the users passes in.

10 years agofrontend: Split up command_handle() into several sdb_fe_<cmd> functions.
Sebastian Harl [Sat, 2 Aug 2014 18:14:50 +0000 (20:14 +0200)]
frontend: Split up command_handle() into several sdb_fe_<cmd> functions.

One big function is not very nice to handle.

10 years agofrontend: Renamed sdb_fe_<cmd> functions to sdb_fe_exec_<cmd>.
Sebastian Harl [Sat, 2 Aug 2014 18:13:49 +0000 (20:13 +0200)]
frontend: Renamed sdb_fe_<cmd> functions to sdb_fe_exec_<cmd>.

That name better describes what the function is doing.

10 years agodata: Simplified the implementation of expr_eval().
Sebastian Harl [Sat, 2 Aug 2014 17:42:24 +0000 (19:42 +0200)]
data: Simplified the implementation of expr_eval().

10 years agofrontend: Make sure to not read to much from a connection buffer.
Sebastian Harl [Sat, 2 Aug 2014 15:10:49 +0000 (17:10 +0200)]
frontend: Make sure to not read to much from a connection buffer.

The current command, as stored in the connection buffer, is not necessarily
nil-terminated. That's only the case if there's no further data in the buffer
(which will *often* be the case in the current implementation when using
'sysdb' as the client) but the code should never rely on that.

In cases where the function operating on the data does not support specifying
the length of the string to work on, copy the data to a temporary buffer
first.

10 years agostore_expr: Fixed a memory leak in an error condition.
Sebastian Harl [Sat, 2 Aug 2014 10:59:44 +0000 (12:59 +0200)]
store_expr: Fixed a memory leak in an error condition.

10 years agostore_expr: Evaluate constant expressions early.
Sebastian Harl [Sat, 2 Aug 2014 10:57:16 +0000 (12:57 +0200)]
store_expr: Evaluate constant expressions early.

That is, when creating a new expression objects, evaluate it right away if its
left and right operands are constant values.

10 years agodata: Document the use of dynamically allocated data in expr_eval().
Sebastian Harl [Sat, 2 Aug 2014 10:41:37 +0000 (12:41 +0200)]
data: Document the use of dynamically allocated data in expr_eval().

10 years agodata: Let sdb_data_expr_eval() check it's arguments.
Sebastian Harl [Sat, 2 Aug 2014 10:35:12 +0000 (12:35 +0200)]
data: Let sdb_data_expr_eval() check it's arguments.

10 years agoversion-gen.sh: Added .git suffix to default version again.
Sebastian Harl [Fri, 1 Aug 2014 18:44:57 +0000 (20:44 +0200)]
version-gen.sh: Added .git suffix to default version again.

10 years agoRelease SysDB 0.3.0. sysdb-0.3.0
Sebastian Harl [Fri, 1 Aug 2014 18:37:53 +0000 (20:37 +0200)]
Release SysDB 0.3.0.

10 years agounit tests: Fixed some -Werror=unused-result compiler errors.
Sebastian Harl [Fri, 1 Aug 2014 18:35:31 +0000 (20:35 +0200)]
unit tests: Fixed some -Werror=unused-result compiler errors.

10 years agoReleaseNotes: Added 0.3.0 release.
Sebastian Harl [Fri, 1 Aug 2014 18:26:30 +0000 (20:26 +0200)]
ReleaseNotes: Added 0.3.0 release.

10 years agodata: Support some arithmetic expressions on mismatching types.
Sebastian Harl [Fri, 1 Aug 2014 06:59:50 +0000 (08:59 +0200)]
data: Support some arithmetic expressions on mismatching types.

The following cases are now supported:
 - <integer> or <decimal> <mul> <datetime>
 - <datetime> <mul> or <div> or <mod> <integer> or <decimal>

Think of <datetime> having a time unit like seconds. It's perfectly fine to
multiply with or divide seconds by a number. However, since we don't have any
type having the unit Hertz, we cannot support numbers divided by <datetime>.

10 years agofrontend/grammar: Added support for field names in expressions.
Sebastian Harl [Thu, 31 Jul 2014 21:38:51 +0000 (23:38 +0200)]
frontend/grammar: Added support for field names in expressions.

10 years agostore_expr: Added support to include field values in an expression.
Sebastian Harl [Thu, 31 Jul 2014 21:09:29 +0000 (23:09 +0200)]
store_expr: Added support to include field values in an expression.

Added sdb_store_expr_fieldvalue() to create such an expression object and pass
a stored object to sdb_store_expr_eval() to be able to extract the field value
when evaluation the expression.

10 years agostore: Added sdb_store_get_field().
Sebastian Harl [Thu, 31 Jul 2014 21:07:30 +0000 (23:07 +0200)]
store: Added sdb_store_get_field().

This function may be used to retrieve the value of queryable fields of objects
in the store.

For now, all fields except the backend(s) are supported.

10 years agosysdbql(7): Document FILTER clauses.
Sebastian Harl [Wed, 30 Jul 2014 19:22:24 +0000 (21:22 +0200)]
sysdbql(7): Document FILTER clauses.

10 years agofrontend: Added 'FILTER' support to the 'LOOKUP' command.
Sebastian Harl [Wed, 30 Jul 2014 19:02:35 +0000 (21:02 +0200)]
frontend: Added 'FILTER' support to the 'LOOKUP' command.

The new syntax is 'LOOKUP <obj> MATCHING <cond> [FILTER <cond>]'.

10 years agot/integration: Execute test scripts using 'set -x'.
Sebastian Harl [Wed, 30 Jul 2014 19:01:11 +0000 (21:01 +0200)]
t/integration: Execute test scripts using 'set -x'.

A lot of tests fail rather silently. This helps identify the failing test.

10 years agofrontend/scanner: Simplified handling of reserved words.
Sebastian Harl [Wed, 30 Jul 2014 09:44:06 +0000 (11:44 +0200)]
frontend/scanner: Simplified handling of reserved words.

10 years agostore, frontend: Parse object field matchers.
Sebastian Harl [Wed, 30 Jul 2014 08:48:23 +0000 (10:48 +0200)]
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.

10 years agofrontend/parser: Added support for time interval values.
Sebastian Harl [Wed, 30 Jul 2014 08:31:39 +0000 (10:31 +0200)]
frontend/parser: Added support for time interval values.

10 years agotime: Added sdb_strpunit() to parse a time unit.
Sebastian Harl [Wed, 30 Jul 2014 08:24:30 +0000 (10:24 +0200)]
time: Added sdb_strpunit() to parse a time unit.

10 years agotime: Renamed PRIscTIME to PRIsdbTIME.
Sebastian Harl [Wed, 30 Jul 2014 07:30:35 +0000 (09:30 +0200)]
time: Renamed PRIscTIME to PRIsdbTIME.

Another remnant of the “syscollector” days ;-)

10 years agofrontend: Let FETCH/LIST/LOOKUP implementations accept filters.
Sebastian Harl [Tue, 29 Jul 2014 20:59:28 +0000 (22:59 +0200)]
frontend: Let FETCH/LIST/LOOKUP implementations accept filters.

This is in preparation for letting the parser support filters. It's not
actually used yet.

10 years agostore: Fixed JSON serialization when skipping hosts due to filters.
Sebastian Harl [Tue, 29 Jul 2014 20:49:44 +0000 (22:49 +0200)]
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.

10 years agostore: Let JSON serializers support (object) filters.
Sebastian Harl [Tue, 29 Jul 2014 20:18:14 +0000 (22:18 +0200)]
store: Let JSON serializers support (object) filters.

Only objects covered by the specified filter will be included in the JSON
output.

10 years agoliboconfig: Relicensed to MIT license.
Sebastian Harl [Tue, 29 Jul 2014 19:14:34 +0000 (21:14 +0200)]
liboconfig: Relicensed to MIT license.

Florian Forster relicensed the code in collectd's Git commit
633c3966f770e4d46651a2fe219a18d8a9907a9f.

<https://github.com/collectd/collectd/commit/633c3966f770e4d46651a2fe219a18d8a9907a9f>

10 years agostore_lookup: Added conditional for accessing store-object fields.
Sebastian Harl [Tue, 29 Jul 2014 18:49:24 +0000 (20:49 +0200)]
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.

10 years agostore_lookup: Make sure to always initialize the buffer in tostring().
Sebastian Harl [Tue, 29 Jul 2014 16:58:37 +0000 (18:58 +0200)]
store_lookup: Make sure to always initialize the buffer in tostring().

10 years agostore: Make matchers more generic and applicable to non-hosts as well.
Sebastian Harl [Mon, 28 Jul 2014 21:36:05 +0000 (23:36 +0200)]
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.

10 years agostore: Introduced the concept of query filters.
Sebastian Harl [Mon, 28 Jul 2014 20:25:04 +0000 (22:25 +0200)]
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.

10 years agostore, frontend: Let lookups support arbitrary expressions for comparison.
Sebastian Harl [Mon, 28 Jul 2014 19:16:14 +0000 (21:16 +0200)]
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.

10 years agostore_lookup: Catch invalid values when parsing a matcher.
Sebastian Harl [Mon, 28 Jul 2014 07:15:19 +0000 (09:15 +0200)]
store_lookup: Catch invalid values when parsing a matcher.

Added a unit-test exposing the segfault we would have seen previously.

10 years agofrontend: Added a parser for arithmetic expressions.
Sebastian Harl [Sun, 27 Jul 2014 22:27:12 +0000 (00:27 +0200)]
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.

10 years agostore_expr: Added framework for arithmetic expressions.
Sebastian Harl [Sun, 27 Jul 2014 22:25:16 +0000 (00:25 +0200)]
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()).

10 years agodata: Added sdb_data_expr_eval().
Sebastian Harl [Sun, 27 Jul 2014 21:06:03 +0000 (23:06 +0200)]
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.

10 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.
Sebastian Harl [Sun, 27 Jul 2014 17:09:01 +0000 (19:09 +0200)]
Merged branch 'master' of git://git.tokkee.org/sysdb.

Conflicts:
src/frontend/grammar.y

10 years agoQuery language: Changed 'LOOKUP .. WHERE' to 'LOOKUP .. MATCHING'.
Sebastian Harl [Sun, 27 Jul 2014 16:42:23 +0000 (18:42 +0200)]
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.

10 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.
Sebastian Harl [Sun, 27 Jul 2014 16:13:55 +0000 (18:13 +0200)]
Merged branch 'master' of git://git.tokkee.org/sysdb.

10 years agostore, frontend: Renamed sdb_store_lookup() to sdb_store_scan().
Sebastian Harl [Sun, 27 Jul 2014 15:35:38 +0000 (17:35 +0200)]
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.