summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d0b1b7c)
raw | patch | inline | side by side (parent: d0b1b7c)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 18 May 2015 20:50:19 +0000 (22:50 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 18 May 2015 20:50:19 +0000 (22:50 +0200) |
src/frontend/query.c | patch | blob | history | |
src/include/frontend/connection.h | patch | blob | history |
diff --git a/src/frontend/query.c b/src/frontend/query.c
index 703853cb59f8be7d22ee39e0419609dbbdc8846f..6015d7dd17275f27d01ef1f312321ca22d4975b9 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
return 0;
} /* sdb_fe_exec_lookup */
-int
-sdb_fe_exec_timeseries(sdb_conn_t *conn,
- const char *hostname, const char *metric,
- sdb_timeseries_opts_t *opts)
-{
- sdb_strbuf_t *buf;
- uint32_t res_type = htonl(SDB_CONNECTION_TIMESERIES);
-
- buf = sdb_strbuf_create(1024);
- if (! buf) {
- char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "frontend: Failed to create "
- "buffer to handle TIMESERIES command: %s",
- sdb_strerror(errno, errbuf, sizeof(errbuf)));
-
- sdb_strbuf_sprintf(conn->errbuf, "Out of memory");
- return -1;
- }
-
- sdb_strbuf_memcpy(buf, &res_type, sizeof(uint32_t));
- if (sdb_store_fetch_timeseries(hostname, metric, opts, buf)) {
- sdb_log(SDB_LOG_ERR, "frontend: Failed to fetch time-series");
- sdb_strbuf_sprintf(conn->errbuf, "Failed to fetch time-series");
- sdb_strbuf_destroy(buf);
- return -1;
- }
-
- sdb_connection_send(conn, SDB_CONNECTION_DATA,
- (uint32_t)sdb_strbuf_len(buf), sdb_strbuf_string(buf));
- sdb_strbuf_destroy(buf);
- return 0;
-} /* sdb_fe_exec_timeseries */
-
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
index 98c41360a990ba11175f2a24150a922185769458..f72f5e267a2787b6470071e0accd1ecfc63d4f39 100644 (file)
sdb_fe_exec_lookup(sdb_conn_t *conn, int type,
sdb_store_matcher_t *m, sdb_store_matcher_t *filter);
-/*
- * sdb_fe_exec_timeseries:
- * Execute the 'TIMESERIES' command. Send the time-series for the specified
- * host's metric, serialized as JSON, to the client. See
- * sdb_store_fetch_timeseries for details.
- *
- * Returns:
- * - 0 on success
- * - a negative value else
- */
-int
-sdb_fe_exec_timeseries(sdb_conn_t *conn,
- const char *hostname, const char *metric,
- sdb_timeseries_opts_t *opts);
-
/*
* sdb_fe_store_host, sdb_fe_store_service, sdb_fe_store_metric,
* sdb_fe_store_attribute: