[OpenAFS-devel] xstat_fs_test, etc
Jeff Blaine
jblaine@kickflop.net
Tue, 28 Jun 2011 20:24:43 -0400
I've split RunTheTest (the actual stat poller) and
CountListItems (an aux function) out of xstat_fs_test.c
into xstat_common.c [FN3]
I've adapted xstat_fs_test.c to use them from there.
The goal of my effort, as above and going forward, is to
allow for some form of monitoring agent or somesuch.
In ultra-particulars for *my* immediate case, we already
syslog all data from all hosts we manage to a single master
host and use Splunk(tm) extensively[FN1]. We'd like an
"agent" splitting stats to syslog (and thus Splunk, which
has built-in time series charting!). Others may implement
something different that feeds data to an RRD, Graphite[FN2],
etc. In fact, we may end up down that road too someday,
but for now we want *something* and we already have the
receiving+parsing+graphing tool in place.
I have several questions at this early stage, and note
that I'm not a C magician:
1. Is that the filename you want the "common" stuff to be?
Let's choose wisely now and not create a turd.
2. The extracted "poller" function has turned ugly
signature-wise, IMO. I'm fine with it, and also
fine with changing it. That's a question, somehow.
poller(struct cmd_item *fslist,
struct cmd_item *collidlist,
int freq,
int period,
int debug,
int oneshot)
3. It's a little presumptuous above, but okay(?)
that fslist and collidlist are struct cmd_item.
Comments?
"RunTheTest()" (the initcmd in xstat_fs_test) now
amounts to little more than:
code = poller(a_s->parms[P_FS_NAMES].items,
a_s->parms[P_COLL_IDS].items,
freq, period, debugging_on, one_shot);
return (code);
From my testing, the xstat_fs_test builds and runs exactly
as before.
Footnotes
FN1:
http://www.kickflop.net/blog/2010/12/10/any-metric-graphing-with-cron-some-code-syslog-and-splunk/
FN2: http://graphite.wikidot.com/
FN3: This was the proposed idea from the Jabber server today,
instead of adding a -syslog argument to xstat_fs_test
because it's "hacky" in others' opinions.