6 years agofrontend/query_test: Simplified result checks.
Sebastian Harl [Tue, 13 Oct 2015 17:09:41 +0000 (19:09 +0200)]
frontend/query_test: Simplified result checks.

Don't track the expected length since it always matches strlen() anyway. The
additional check would hide the diff if it failed, adding an unnecessary step
for debugging failures.

6 years agoFETCH: Add parameter for fetching the main object without children.
Sebastian Harl [Fri, 9 Oct 2015 16:56:12 +0000 (18:56 +0200)]
FETCH: Add parameter for fetching the main object without children.

That is, exclude any attributes or child objects.

Use this to simplify the TIMESERIES fetcher which no longer requires an
attribute callback.

6 years agoSplit the memstore module from the store module.
Sebastian Harl [Wed, 7 Oct 2015 21:45:51 +0000 (23:45 +0200)]
Split the memstore module from the store module.

6 years agoRenamed in-memory store types and functions to sdb_memstore*.
Sebastian Harl [Wed, 7 Oct 2015 20:25:29 +0000 (22:25 +0200)]
Renamed in-memory store types and functions to sdb_memstore*.

6 years agoconnection: Drop old and unused conn_node* types.
Sebastian Harl [Wed, 7 Oct 2015 20:23:18 +0000 (22:23 +0200)]
connection: Drop old and unused conn_node* types.

This was part of the old parser implementation.

6 years agoRemoved sdb_store_fetch_timeseries from headers; it's gone.
Sebastian Harl [Wed, 7 Oct 2015 07:31:14 +0000 (09:31 +0200)]
Removed sdb_store_fetch_timeseries from headers; it's gone.

6 years agostore: Use full initializers for store objects.
Sebastian Harl [Tue, 6 Oct 2015 20:17:29 +0000 (22:17 +0200)]
store: Use full initializers for store objects.

Older versions of GCC/CLANG don't handle "missing" field initializers well.

6 years agoconfigure: Include rrd.h when checking for rrd_client.h.
Sebastian Harl [Tue, 6 Oct 2015 20:06:39 +0000 (22:06 +0200)]
configure: Include rrd.h when checking for rrd_client.h.

Apparently, this is needed for RRDtool 1.5.

6 years agoBuild a more generic/powerful query API which writes to a store-writer.
Sebastian Harl [Tue, 6 Oct 2015 19:47:34 +0000 (21:47 +0200)]
Build a more generic/powerful query API which writes to a store-writer.

Instead of letting the query implementation write JSON directly, let them emit
objects to a store-writer. This allows for more powerful and centralized
post-processing of the data and avoids code-duplication by moving all logic of
how to write out the data to the core. Also, this had a couple of nice side
effects and allowed for further simplication:

 - The TIMESERIES command is now handled by the front-end (based on a FETCH of
   the respective metric data); query plugin no longer have to implement this.

 - All protocol specific information is now handled by the frontend; query
   plugins no longer have to handle this (response-type).

 - Further separation of the memory-store and generic store code.

6 years agoMove the timeseries serialize to the timeseries module.
Sebastian Harl [Tue, 6 Oct 2015 19:34:25 +0000 (21:34 +0200)]
Move the timeseries serialize to the timeseries module.

6 years agostore: Don't report an error if a missing writer callback isn't used.
Sebastian Harl [Tue, 6 Oct 2015 18:01:27 +0000 (20:01 +0200)]
store: Don't report an error if a missing writer callback isn't used.

That is, allow to emit store objects to an incomplete writer as long as all
required callbacks are present.

6 years agostore: Use the JSON writer when querying the in-memory store.
Sebastian Harl [Wed, 30 Sep 2015 20:10:25 +0000 (22:10 +0200)]
store: Use the JSON writer when querying the in-memory store.

That is, instead of writing to a JSON formatter directly, access it through
it's writer API. This will allow for more flexible store access.

6 years agostore_json: Base the memstore emitter on the store-writer API.
Sebastian Harl [Wed, 30 Sep 2015 09:18:22 +0000 (11:18 +0200)]
store_json: Base the memstore emitter on the store-writer API.

6 years agostore_json: Let the formatter implement the store-writer interface.
Sebastian Harl [Wed, 30 Sep 2015 09:17:07 +0000 (11:17 +0200)]
store_json: Let the formatter implement the store-writer interface.

6 years agoRead-only store types: const char ** → const char * const *.
Sebastian Harl [Wed, 30 Sep 2015 09:14:46 +0000 (11:14 +0200)]
Read-only store types: const char ** → const char * const *.

This makes it truely read-only.

7 years agostore_json: Remove any memstore-specific code.
Sebastian Harl [Mon, 28 Sep 2015 20:15:41 +0000 (22:15 +0200)]
store_json: Remove any memstore-specific code.

This will allow to further separate the JSON code from the memstore

7 years agostore_json: Fix parent/child detection.
Sebastian Harl [Mon, 28 Sep 2015 20:07:08 +0000 (22:07 +0200)]
store_json: Fix parent/child detection.

Rewinding the formatter state has to happen any time we see a parent object of
the current object. This happens every time the current context isn't HOST
(hosts don't have any parents) or the new object is an ATTRIBUTE (which are
always children of whatever other object type).

This broke in 3603db13105aefac4d6ceb356bcfd118a92fa654.

7 years agostore_json: Split sdb_store_json_emit into private functions.
Sebastian Harl [Mon, 28 Sep 2015 08:06:33 +0000 (10:06 +0200)]
store_json: Split sdb_store_json_emit into private functions.

The public function will only handle memstore specific logic.

7 years agostore_json: Moved special casing of parent objects into the caller.
Sebastian Harl [Mon, 28 Sep 2015 07:54:15 +0000 (09:54 +0200)]
store_json: Moved special casing of parent objects into the caller.

This makes the JSON module more generic by removing a special case of the
memory store. The caller may now emit arbitrary objects and the formatter will
do the right thing as long as parent-child relationships are right.

7 years agostore, plugin: Let the plugin module determine an objects backends.
Sebastian Harl [Thu, 24 Sep 2015 18:49:55 +0000 (20:49 +0200)]
store, plugin: Let the plugin module determine an objects backends.

The store writer plugins are only expected to record the provided backend
(after merging it with existing entries).

7 years agostore: Further abstract internal handling of new objects.
Sebastian Harl [Thu, 24 Sep 2015 07:38:26 +0000 (09:38 +0200)]
store: Further abstract internal handling of new objects.

Add a new type representing a to-be-stored object to simplify storing new

7 years agostore: Simplified store-attribute callback.
Sebastian Harl [Wed, 23 Sep 2015 19:49:38 +0000 (21:49 +0200)]
store: Simplified store-attribute callback.

There's no need anymore to split this across multiple functions. It's easier
to follow if the code is in one place.

7 years agostore: Add separate store-object types for the store writer API.
Sebastian Harl [Tue, 22 Sep 2015 08:09:24 +0000 (10:09 +0200)]
store: Add separate store-object types for the store writer API.

The argument list of some of the callbacks has already gotten kinda long and
we'll want to add more (backends, etc.). Introduce new types which provide all
meta-data of the respective store types.

Also, only use a single callback to store all kinds of attributes, similar to
how it was already done in the "proto" module.

7 years agostore: Dropped sdb_ prefix from private store types.
Sebastian Harl [Thu, 17 Sep 2015 07:20:15 +0000 (09:20 +0200)]
store: Dropped sdb_ prefix from private store types.

7 years agostore.h: Updated some documentation comments.
Sebastian Harl [Wed, 16 Sep 2015 19:46:18 +0000 (21:46 +0200)]
store.h: Updated some documentation comments.

A store instance isn't synonym to "the database" anymore.

7 years agoplugin, store: Add service/metric "hostname" attributes centrally.
Sebastian Harl [Wed, 16 Sep 2015 19:33:05 +0000 (21:33 +0200)]
plugin, store: Add service/metric "hostname" attributes centrally.

That is, let the respective sdb_plugin_store* functions do that instead of
requiring each store implementation to do so.

7 years agofrontend/query_test: Test some weird, special cases.
Sebastian Harl [Thu, 3 Sep 2015 08:05:38 +0000 (10:05 +0200)]
frontend/query_test: Test some weird, special cases.

7 years agostore: Fix execution of more complex iterators.
Sebastian Harl [Wed, 2 Sep 2015 22:40:39 +0000 (00:40 +0200)]
store: Fix execution of more complex iterators.

That is, follow "indirections" of typed expressions if the iterator is not on
the top-most level.

7 years agoRemove unused sdb_store_expr_iterable().
Sebastian Harl [Wed, 2 Sep 2015 22:13:25 +0000 (00:13 +0200)]
Remove unused sdb_store_expr_iterable().

7 years agoAllow and implement iterating arbitrary (non-constant) array values.
Sebastian Harl [Wed, 2 Sep 2015 21:49:20 +0000 (23:49 +0200)]
Allow and implement iterating arbitrary (non-constant) array values.

That is, iterators may now work with arithmetic expressions that evaluate to
an array.

7 years agoanalyzer: Support more flexible iterator expressions.
Sebastian Harl [Mon, 31 Aug 2015 20:50:20 +0000 (22:50 +0200)]
analyzer: Support more flexible iterator expressions.

In particular, more complex typed expressions may now include an iterator on a
lower level, like `LOOKUP services MATCHING ANY host.backend =~ 'foo'`. This
is done by adding more information to the analyzer context and pushing it down
to child nodes in the AST if necessary.

As a nice side-effect, the iterator analyzer does not longer have to know
about the specific type of its child node.

7 years agoanalyzer: Fixed some error messages.
Sebastian Harl [Mon, 31 Aug 2015 20:28:28 +0000 (22:28 +0200)]
analyzer: Fixed some error messages.

7 years agoparser: Require a context for each parser operation.
Sebastian Harl [Mon, 31 Aug 2015 20:08:45 +0000 (22:08 +0200)]
parser: Require a context for each parser operation.

That is, let the caller provide the execution context (object type) when
parsing incomplete commands (conditionals / arithmetic expressions). This
removes the need to call the analyzer again and avoids some special code in
the analyzer.

7 years agoLet the front-end handle STORE commands.
Sebastian Harl [Mon, 24 Aug 2015 19:16:06 +0000 (21:16 +0200)]
Let the front-end handle STORE commands.

… rather than requiring each reader plugin to do so which doesn't make any
sense at all.

7 years agot/integration/ Add integration tests for the STORE command.
Sebastian Harl [Mon, 24 Aug 2015 19:15:28 +0000 (21:15 +0200)]
t/integration/ Add integration tests for the STORE command.

7 years agostore: Do not canonicalize the hostname when fetching a timeseries.
Sebastian Harl [Thu, 13 Aug 2015 17:02:14 +0000 (19:02 +0200)]
store: Do not canonicalize the hostname when fetching a timeseries.

This decision should be made on a higher level.

7 years agofrontend: Connection-specific functions now use the sdb_conn_ prefix.
Sebastian Harl [Thu, 13 Aug 2015 16:55:34 +0000 (18:55 +0200)]
frontend: Connection-specific functions now use the sdb_conn_ prefix.

… instead of sdb_fe_.

7 years agofrontend/connection.h: Removed sdb_fe_parse, it has been dropped.
Sebastian Harl [Thu, 13 Aug 2015 07:04:51 +0000 (09:04 +0200)]
frontend/connection.h: Removed sdb_fe_parse, it has been dropped.

7 years agostore: Removed obsolete TODO note.
Sebastian Harl [Thu, 13 Aug 2015 06:52:34 +0000 (08:52 +0200)]
store: Removed obsolete TODO note.

7 years agoplugin, store: Handle hostname canonicalization in the plugin module.
Sebastian Harl [Wed, 12 Aug 2015 19:55:41 +0000 (21:55 +0200)]
plugin, store: Handle hostname canonicalization in the plugin module.

This is a high-level functionality. Each store implementation should not have
to worry about it.

7 years agosysdb(7): Briefly mention the object store.
Sebastian Harl [Mon, 10 Aug 2015 07:44:23 +0000 (09:44 +0200)]
sysdb(7): Briefly mention the object store.

7 years agosysdbd-store-memory(5): Added a manpage for store::memory.
Sebastian Harl [Mon, 10 Aug 2015 07:36:50 +0000 (09:36 +0200)]
sysdbd-store-memory(5): Added a manpage for store::memory.

7 years agostore::memory: Add a plugin providing an in-memory store.
Sebastian Harl [Sun, 9 Aug 2015 22:19:28 +0000 (00:19 +0200)]
store::memory: Add a plugin providing an in-memory store.

This plugin replaces the default, built-in store. It is a simple wrapper
around the built-in store implementation and, thus, provides exactly the same
functionality but wrapped into a plugin.

7 years agot/Makefile: Drop unused, old frontend/parser_test.
Sebastian Harl [Sun, 9 Aug 2015 21:55:23 +0000 (23:55 +0200)]
t/Makefile: Drop unused, old frontend/parser_test.

7 years agoplugin: Report an error when writing to the store with no writers.
Sebastian Harl [Sat, 8 Aug 2015 07:57:48 +0000 (09:57 +0200)]
plugin: Report an error when writing to the store with no writers.

7 years agostore: Drop the global (default) store.
Sebastian Harl [Sat, 8 Aug 2015 07:34:56 +0000 (09:34 +0200)]
store: Drop the global (default) store.

Instead, register a store from sysdbd and make sure to re-register it on
reconfigure. Previously, the store plugin would have been dropped in that

7 years agostore: All store functions now accept a store object.
Sebastian Harl [Fri, 7 Aug 2015 16:26:51 +0000 (18:26 +0200)]
store: All store functions now accept a store object.

That is, instead of operating on a global, shared instance.

7 years agostore: Add wrapper functions to store an object in an arbitrary store.
Sebastian Harl [Thu, 6 Aug 2015 15:39:45 +0000 (17:39 +0200)]
store: Add wrapper functions to store an object in an arbitrary store.

7 years agocore: Export the sdb_store, sdb_store_reader, sdb_store_writer types.
Sebastian Harl [Thu, 6 Aug 2015 15:22:31 +0000 (17:22 +0200)]
core: Export the sdb_store, sdb_store_reader, sdb_store_writer types.

This is in preparation to more flexible store handling.

7 years agot/valgrind.suppress: Refine the suppression in the libc exit handler.
Sebastian Harl [Thu, 6 Aug 2015 06:56:24 +0000 (08:56 +0200)]
t/valgrind.suppress: Refine the suppression in the libc exit handler.

7 years agofrontend: Use the plugin query interface instead of direct store access.
Sebastian Harl [Wed, 5 Aug 2015 08:45:11 +0000 (10:45 +0200)]
frontend: Use the plugin query interface instead of direct store access.

The built-in store is registered as a reader automatically at the moment.

7 years agocore: Add support for reader/query plugins.
Sebastian Harl [Wed, 5 Aug 2015 08:38:48 +0000 (10:38 +0200)]
core: Add support for reader/query plugins.

A reader plugin can be used to query a data-store based on a query described
by an AST. The plugin module provides a generic function for this purpose.

At the moment, only a single reader plugin can be used at a time. Supporting
multiple readers requires a good merge strategy. The challenge is to handle
filters and query conditions correctly which may evaluate differently after
two stores have been merged.

7 years agot/valgrind.suppress: Add an invalid free in a libc exit handler.
Sebastian Harl [Tue, 4 Aug 2015 07:13:47 +0000 (09:13 +0200)]
t/valgrind.suppress: Add an invalid free in a libc exit handler.

7 years agoplugin: Drop sdb_plugin prefix from private names.
Sebastian Harl [Thu, 28 May 2015 08:29:21 +0000 (10:29 +0200)]
plugin: Drop sdb_plugin prefix from private names.

7 years agostore_exec: Remove unnecessary casts.
Sebastian Harl [Thu, 28 May 2015 08:08:45 +0000 (10:08 +0200)]
store_exec: Remove unnecessary casts.

7 years agostore: Let sdb_store_json_formatter_t inherit from sdb_object_t.
Sebastian Harl [Wed, 27 May 2015 20:49:20 +0000 (22:49 +0200)]
store: Let sdb_store_json_formatter_t inherit from sdb_object_t.

7 years agoDrop sdb_store_get_host() from tests.
Sebastian Harl [Wed, 27 May 2015 20:48:21 +0000 (22:48 +0200)]
Drop sdb_store_get_host() from tests.

7 years agostore: Drop unused sdb_store_has_host.
Sebastian Harl [Fri, 22 May 2015 07:21:26 +0000 (09:21 +0200)]
store: Drop unused sdb_store_has_host.

7 years agoReplaced sdb_store_<type> with sdb_plugin_store_<type>.
Sebastian Harl [Thu, 21 May 2015 22:47:24 +0000 (00:47 +0200)]
Replaced sdb_store_<type> with sdb_plugin_store_<type>.

That is, all store updates will now directly go through the plugin API and be
distributed to all store-writer plugins from there.

7 years agoMerged branch 'master' of git://
Sebastian Harl [Thu, 21 May 2015 22:46:58 +0000 (00:46 +0200)]
Merged branch 'master' of git://

7 years agostore: Register a store writer and handle all updates through the plugin API.
Sebastian Harl [Thu, 21 May 2015 22:18:25 +0000 (00:18 +0200)]
store: Register a store writer and handle all updates through the plugin API.

We still reference a global store object. This change further encapsulates the

7 years agoplugin: sdb_plugin_store_* now return >0 if the new value was too old.
Sebastian Harl [Thu, 21 May 2015 22:16:04 +0000 (00:16 +0200)]
plugin: sdb_plugin_store_* now return >0 if the new value was too old.

That is, the return values now mean the same as for the sdb_store_* functions.

7 years agostore: Reordered some functions to group by general purpose.
Sebastian Harl [Thu, 21 May 2015 21:42:11 +0000 (23:42 +0200)]
store: Reordered some functions to group by general purpose.

7 years agoFix an uninitialized value warnings caused by clang not knowing about fail().
Sebastian Harl [Thu, 21 May 2015 21:39:22 +0000 (23:39 +0200)]
Fix an uninitialized value warnings caused by clang not knowing about fail().

7 years agostore: Make the actual store a separate object.
Sebastian Harl [Thu, 21 May 2015 21:36:57 +0000 (23:36 +0200)]
store: Make the actual store a separate object.

That'll allow us to use different store objects in multiple places in the

7 years agostore: Drop sdb_ prefix from private symbols.
Sebastian Harl [Thu, 21 May 2015 18:17:42 +0000 (20:17 +0200)]
store: Drop sdb_ prefix from private symbols.

7 years agodata: Use a predefined format for sdb_strftime().
Sebastian Harl [Wed, 20 May 2015 21:53:48 +0000 (23:53 +0200)]
data: Use a predefined format for sdb_strftime().

Also, print the nanosecond fraction of a second.

7 years agot/: Use ck_assert() instead of assert() in all tests.
Sebastian Harl [Wed, 20 May 2015 20:04:54 +0000 (22:04 +0200)]
t/: Use ck_assert() instead of assert() in all tests.

7 years agosysdbql(7): Document 'value' and 'timeseries' fields.
Sebastian Harl [Wed, 20 May 2015 09:36:37 +0000 (11:36 +0200)]
sysdbql(7): Document 'value' and 'timeseries' fields.

7 years agoparser: Add support for metric timeseries fields.
Sebastian Harl [Wed, 20 May 2015 08:35:29 +0000 (10:35 +0200)]
parser: Add support for metric timeseries fields.

7 years agostore: Add the timeseries field to metrics.
Sebastian Harl [Wed, 20 May 2015 08:34:27 +0000 (10:34 +0200)]
store: Add the timeseries field to metrics.

This is a boolean field that specifies whether a timeseries for the metric is
known to SysDB.

7 years agoparser: Skip context-specific checks if the context is unspecified.
Sebastian Harl [Wed, 20 May 2015 08:32:37 +0000 (10:32 +0200)]
parser: Skip context-specific checks if the context is unspecified.

Else, the analyzer may reject valid queries. It's up to the caller to run the
analyzer using the right context once it's known.

7 years agostore: Remove (now unused) sdb_store_parse_*() helpers.
Sebastian Harl [Wed, 20 May 2015 06:49:38 +0000 (08:49 +0200)]
store: Remove (now unused) sdb_store_parse_*() helpers.

7 years agostore: Remove (now unused) sdb_store_nin_matcher().
Sebastian Harl [Wed, 20 May 2015 06:48:42 +0000 (08:48 +0200)]
store: Remove (now unused) sdb_store_nin_matcher().

7 years agosysdbql(7): Document IS [NOT] TRUE / FALSE.
Sebastian Harl [Tue, 19 May 2015 21:17:11 +0000 (23:17 +0200)]
sysdbql(7): Document IS [NOT] TRUE / FALSE.

7 years agoparser: Add support for <expr> IS [NOT] TRUE / FALSE queries.
Sebastian Harl [Tue, 19 May 2015 21:11:35 +0000 (23:11 +0200)]
parser: Add support for <expr> IS [NOT] TRUE / FALSE queries.

7 years agostore: Add support for unary IS TRUE / IS FALSE matchers.
Sebastian Harl [Tue, 19 May 2015 21:08:30 +0000 (23:08 +0200)]
store: Add support for unary IS TRUE / IS FALSE matchers.

7 years agostore: Drop the special IS-NOT-NULL matcher.
Sebastian Harl [Tue, 19 May 2015 20:28:49 +0000 (22:28 +0200)]
store: Drop the special IS-NOT-NULL matcher.

In the AST world, this is NOT(IS-NULL).

7 years agoutils/proto: Support boolean values.
Sebastian Harl [Tue, 19 May 2015 20:11:50 +0000 (22:11 +0200)]
utils/proto: Support boolean values.

They are encoded as a single byte on the wire.

7 years agodata: Add basic support for a boolean type.
Sebastian Harl [Tue, 19 May 2015 19:42:20 +0000 (21:42 +0200)]
data: Add basic support for a boolean type.

This change breaks backward compatibility of the network protocol because it
changes the encoding of a datum. I felt this is still acceptable (given the
current (non-)compatibility promise) and it made the order of types feel more
natural ;-)

7 years agoDrop the old frontend parser.
Sebastian Harl [Tue, 19 May 2015 18:10:22 +0000 (20:10 +0200)]
Drop the old frontend parser.

It's fully replaced by the new parser module now.

7 years agostore: Add sdb_store_query_prepare_matcher().
Sebastian Harl [Tue, 19 May 2015 18:08:56 +0000 (20:08 +0200)]
store: Add sdb_store_query_prepare_matcher().

This prepares a logical expression described by an AST for execution as a
store matcher. This is useful for anything that uses the lower level store
lookup functions.

7 years agofrontend: Drop sdb_fe_store_* in favor of sdb_store_query_execute.
Sebastian Harl [Mon, 18 May 2015 21:57:06 +0000 (23:57 +0200)]
frontend: Drop sdb_fe_store_* in favor of sdb_store_query_execute.

Instead, build a temporary AST to represent the command to be executed.

7 years agofrontend: Drop sdb_fe_exec_* in favor of sdb_store_query_execute.
Sebastian Harl [Mon, 18 May 2015 21:14:54 +0000 (23:14 +0200)]
frontend: Drop sdb_fe_exec_* in favor of sdb_store_query_execute.

Instead, build a temporary AST to represent the command to be executed.

7 years agoRemove (now) usued sdb_fe_exec_timeseries().
Sebastian Harl [Mon, 18 May 2015 20:50:19 +0000 (22:50 +0200)]
Remove (now) usued sdb_fe_exec_timeseries().

7 years agofrontend/query_test: Add tests for the lower level functions.
Sebastian Harl [Mon, 18 May 2015 20:48:57 +0000 (22:48 +0200)]
frontend/query_test: Add tests for the lower level functions.

7 years agofrontend/query: Split AST execution into a separate function.
Sebastian Harl [Mon, 18 May 2015 19:18:40 +0000 (21:18 +0200)]
frontend/query: Split AST execution into a separate function.

7 years agostore: Use a separate type for prepared querys.
Sebastian Harl [Mon, 18 May 2015 19:04:18 +0000 (21:04 +0200)]
store: Use a separate type for prepared querys.

It's sufficiently different from the general matchers/filters approach to not
benefit from sharing a base type.

7 years agostore, frontend: Add sdb_store_query_execute use it instead of sdb_fe_exec.
Sebastian Harl [Sun, 17 May 2015 19:58:03 +0000 (21:58 +0200)]
store, frontend: Add sdb_store_query_execute use it instead of sdb_fe_exec.

This new function executes a generic QUERY matcher as returned by
sdb_store_query_prepare and writes the reply to a string buffer.

7 years agoMerged branch 'master' of git://
Sebastian Harl [Fri, 15 May 2015 20:53:44 +0000 (22:53 +0200)]
Merged branch 'master' of git://

7 years agofrontend/query_test: Test various QUERY functions.
Sebastian Harl [Fri, 15 May 2015 20:41:43 +0000 (22:41 +0200)]
frontend/query_test: Test various QUERY functions.

These will, in turn, call the sdb_fe_exec_<CMD> functions, thus guaranteeing
good test coverage.

7 years agofrontend: Fixed reply from STORE command.
Sebastian Harl [Fri, 15 May 2015 20:40:00 +0000 (22:40 +0200)]
frontend: Fixed reply from STORE command.

7 years agostore: Fixed a memory leak in fetch_timeseries().
Sebastian Harl [Fri, 15 May 2015 20:39:26 +0000 (22:39 +0200)]
store: Fixed a memory leak in fetch_timeseries().

7 years agofrontend, parser: Allow typed access to host objects from any context.
Sebastian Harl [Fri, 15 May 2015 19:41:14 +0000 (21:41 +0200)]
frontend, parser: Allow typed access to host objects from any context.

That is, even from the "generic" or "filter" contexts.

7 years agostore: Add sdb_store_query_prepare().
Sebastian Harl [Fri, 15 May 2015 08:03:47 +0000 (10:03 +0200)]
store: Add sdb_store_query_prepare().

This function prepares a query, represented by its AST, for execution in a
store by generating a store matcher.

7 years agostore: Store a service/metric's parent hostname as an attribute.
Sebastian Harl [Thu, 14 May 2015 22:43:12 +0000 (00:43 +0200)]
store: Store a service/metric's parent hostname as an attribute.

7 years agostore: Fixed handling of metric store values.
Sebastian Harl [Thu, 14 May 2015 22:41:12 +0000 (00:41 +0200)]
store: Fixed handling of metric store values.

 - Call sdb_plugin_store_metric() even if store=NULL (don't return early).
 - Don't drop old values if strdup failed when storing store type/id.
 - Fixed a segfault in sdb_plugin_store_metric() when using store=NULL.

7 years agoparser/analyzer: Fixed iterator type checks.
Sebastian Harl [Fri, 8 May 2015 16:49:59 +0000 (18:49 +0200)]
parser/analyzer: Fixed iterator type checks.

Also, added some more test-cases covering affected cases.

7 years agot/coverage: Ignore parser/scanner and parser/grammar.
Sebastian Harl [Wed, 6 May 2015 22:32:35 +0000 (00:32 +0200)]
t/coverage: Ignore parser/scanner and parser/grammar.

7 years agot/Makefile: Update EXTRA_DIST based on recent changes.
Sebastian Harl [Wed, 6 May 2015 22:27:32 +0000 (00:27 +0200)]
t/Makefile: Update EXTRA_DIST based on recent changes.