summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad707ff)
raw | patch | inline | side by side (parent: ad707ff)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 8 Nov 2008 22:57:18 +0000 (22:57 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 8 Nov 2008 22:57:18 +0000 (22:57 +0000) |
program/doc/rrdcached.pod | patch | blob | history | |
program/src/rrd_daemon.c | patch | blob | history |
index a346d601f6cddc5d13b65df15737a868378c5320..274be6fade4f050235d3a911bd08a91f5a10be05 100644 (file)
Removes I<filename> from the cache. Any pending updates B<WILL BE LOST>.
+=item B<QUEUE>
+
+Shows the files that are on the output queue. Returns zero or more lines
+in the following format, where E<lt>num_valsE<gt> is the number of values
+to be written for the E<lt>fileE<gt>:
+
+ <num_vals> <file>
+
=item B<HELP> [I<command>]
Returns a short usage message. If no command is given, or I<command> is
index 2b8ac5814cc3d0c2028548d22886e07f9dbe299c..d56cf06da51ddde4126d302557b9a3915f257244 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
"FLUSHALL\n"
"PENDING <filename>\n"
"FORGET <filename>\n"
+ "QUEUE\n"
"UPDATE <filename> <values> [<values> ...]\n"
"BATCH\n"
"STATS\n"
"Any pending updates for the file will be lost.\n"
};
+ char *help_queue[2] =
+ {
+ "Help for QUEUE\n"
+ ,
+ "Shows all files in the output queue.\n"
+ "The output is zero or more lines in the following format:\n"
+ "(where <num_vals> is the number of values to be written)\n"
+ "\n"
+ "<num_vals> <filename>\n"
+ "\n"
+ };
+
char *help_update[2] =
{
"Help for UPDATE\n"
help_text = help_pending;
else if (strcasecmp (command, "forget") == 0)
help_text = help_forget;
+ else if (strcasecmp (command, "queue") == 0)
+ help_text = help_queue;
else if (strcasecmp (command, "stats") == 0)
help_text = help_stats;
else if (strcasecmp (command, "batch") == 0)
assert(1==0);
} /* }}} static int handle_request_forget */
+static int handle_request_queue (listen_socket_t *sock) /* {{{ */
+{
+ cache_item_t *ci;
+
+ pthread_mutex_lock(&cache_lock);
+
+ ci = cache_queue_head;
+ while (ci != NULL)
+ {
+ add_response_info(sock, "%d %s\n", ci->values_num, ci->file);
+ ci = ci->next;
+ }
+
+ pthread_mutex_unlock(&cache_lock);
+
+ return send_response(sock, RESP_OK, "in queue.\n");
+} /* }}} int handle_request_queue */
+
static int handle_request_update (listen_socket_t *sock, /* {{{ */
time_t now,
char *buffer, size_t buffer_size)
return (handle_request_pending(sock, buffer_ptr, buffer_size));
else if (strcasecmp (command, "forget") == 0)
return (handle_request_forget(sock, buffer_ptr, buffer_size));
+ else if (strcasecmp (command, "queue") == 0)
+ return (handle_request_queue(sock));
else if (strcasecmp (command, "stats") == 0)
return (handle_request_stats (sock));
else if (strcasecmp (command, "help") == 0)