tabled: make two dump displays uniform
PATCH 1/7 tabled: make two dump displays uniform
Quoted 9 lines
From: Jeff Garzik <[email protected]>
Subject: Re: Tabled issues
Date: Mon, 29 Mar 2010 15:32:33 -0400I asserted that the standard stats dump facility must dump all available statistics. That does not exclude other methods of stat(us) dumping. Your patch added new stats to the HTML-pretty version of output, but failed to add the new stats to the standard stat dump facility.
Your wish is my command.
--- server/replica.c | 28 +++++++++++++++++++++++++ server/server.c | 47 ++++++++++++++++++++++++++++++++++-------- server/status.c | 22 +------------------ server/storage.c | 50 +++++++++++++++++++++++++++++++++++++++++---- server/tabled.h | 3 ++ 5 files changed, 117 insertions(+), 33 deletions(-)
commit 6bba495d750dcc7ebe63938b91d4bb22740879fe
Author: Pete Zaitcev <[email protected]> Date: Thu Apr 1 18:58:08 2010 -0600
Make signal+applog and HTTP displays uniform.
server/replica.c +28 -0
@@ -871,6 +871,34 @@ void rep_start() kscan_enabled = true; } +void rep_stats () +{ +bool running; +unsigned long kcnt; +time_t last; + +applog (LOG_INFO ,"REP: Jobs: queued %d active %d done %d" , + queue.njobs, active.njobs, done.njobs); + +g_mutex_lock (kscan_mutex); + running = kscan_running; + last = kscan_last; + kcnt = kscan_cnt; +g_mutex_unlock (kscan_mutex); + +if (running) { +applog (LOG_INFO ,"REP: run Active started %lu scanned %lu" , + (long ) last, kcnt); + }else { +if (last) +applog (LOG_INFO , +"REP: run Done started %lu scanned %lu" , + (long ) last, kcnt); +else +applog (LOG_INFO ,"REP: run None" ); + } +} +bool rep_status (struct client *cli,GList *content) {time_t now;
server/server.c +38 -9
59 lines not on this page · raw message
server/status.c +2 -20
@@ -114,25 +114,6 @@ out:return false; } -static bool stat_status (struct client *cli,GList *content) -{ -char *str; - -/* -* The loadavg is system dependent, we'll figure it out later. -* On Linux, applications read from /proc/loadavg. -*/ -if (asprintf (&str, -"<h1>Status</h1>" -"<p>Host %s port %s</p>\r\n" -"<p>Stats: poll %lu event %lu</p>\r\n" , - tabled_srv.ourhost, tabled_srv.port, - tabled_srv.stats.poll, tabled_srv.stats.event) <0 ) -return false; - content =g_list_append (content, str); -return true; -} -static bool stat_root (struct client *cli) {GList *content =NULL ;
@@ -149,7 +130,8 @@ static bool stat_root(struct client *cli)if (!stat_status (cli, content)) goto out_err; - +if (!stor_status (cli, content)) + goto out_err;if (!rep_status (cli, content)) goto out_err;
server/storage.c +46 -4
57 lines not on this page · raw message
server/tabled.h +3 -0
@@ -315,6 +315,7 @@ extern void req_sign(struct http_req *req, const char *bucket, const char *key,extern int debugging;extern struct server tabled_srv;extern struct compiled_pat patterns[]; +extern bool stat_status (struct client *cli,GList *content);extern bool cli_err (struct client *cli,enum errcode code);extern bool cli_err_write (struct client *cli,char *hdr,char *content);extern bool cli_resp_xml (struct client *cli,int http_status,GList *content);
@@ -357,6 +358,7 @@ extern void stor_add_node(uint32_t nid, const char *hostname, const char *portstr, struct geo *locp);extern int stor_node_check (struct storage_node *stn);extern void stor_stats (void ); +extern bool stor_status (struct client *cli,GList *content);/* storparse.c */ extern void stor_parse (char *fname,const char *text,size_t len);
@@ -364,6 +366,7 @@ extern void stor_parse(char *fname, const char *text, size_t len);/* replica.c */ extern void rep_init (struct event_base *ev_base);extern void rep_start (void ); +extern void rep_stats (void );extern bool rep_status (struct client *cli,GList *content);#endif /* __TABLED_H__ */
These patch series look good from a quick glance. Will apply after Easter holiday...
Jeff
Quoted 2 lines · On Fri, 02 Apr 2010 13:27:10 -0400 Jeff Garzik <[email protected]> wrote:
These patch series look good from a quick glance. Will apply after Easter holiday...
Thanks. They should be ok to overtake the end-to-end verbosity, but there may be some textual conflicts...
-- Pete
Jeff Garzik
AppliedQuoted 14 lines · Pete Zaitcev
Quoted 9 lines
From: Jeff Garzik<[email protected]>
Subject: Re: Tabled issues
Date: Mon, 29 Mar 2010 15:32:33 -0400I asserted that the standard stats dump facility must dump all available statistics. That does not exclude other methods of stat(us) dumping. Your patch added new stats to the HTML-pretty version of output, but failed to add the new stats to the standard stat dump facility.
Your wish is my command.
Signed-off-by Pete Zaitcev<[email protected]>
Quoted 7 lines
--- server/replica.c | 28 +++++++++++++++++++++++++ server/server.c | 47 ++++++++++++++++++++++++++++++++++-------- server/status.c | 22 +------------------ server/storage.c | 50 +++++++++++++++++++++++++++++++++++++++++---- server/tabled.h | 3 ++ 5 files changed, 117 insertions(+), 33 deletions(-)
applied, thanks. I will endeavor to make the stats dump more like nfs4d in the future, FWIW.
Quoted 2 lines · On Tue, 06 Apr 2010 12:57:57 -0400 Jeff Garzik <[email protected]> wrote:
applied, thanks. I will endeavor to make the stats dump more like nfs4d in the future, FWIW.
I was going to look into it too, but there's now some stuff I urgently need to address in Darcy's report on tabled's faults. So I only wrote nfs4 into the endless TODO.
-- Pete