From: Neil Brown <neilb@suse.de>
To: "david m. richter" <richterd@citi.umich.edu>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 0/5] nfsstat: more --diff-stat/--sleep items
Date: Fri, 10 Aug 2007 15:13:39 +1000 [thread overview]
Message-ID: <18107.62467.713097.170392@notabene.brown> (raw)
In-Reply-To: message from david m. richter on Thursday August 9
On Thursday August 9, richterd@citi.umich.edu wrote:
>
> i'd like some input on your idea of adding a timeout to --sleep: i
> took 5 minutes and dropped it in yesterday, but ran into a getopt_long(3)
> issue. i had wanted to just add the timeout as an optional argument to
> --sleep, as opposed to adding a separate timeout flag (ugh).
>
> unless i'm doing something wrong (and i'll poke at it now, maybe
> i'm being dumb), it seems that getopt wants to see those optional args in
> the forms:
>
> nfsstat --sleep=5
> nfsstat -Z5
>
> .. but doesn't grok the optarg in these, which are more natural to me:
>
> nfsstat --sleep 5
> nfsstat -Z 5
>
> if i'm not doing something wrong, what's the feeling about going
> with -Z5 versus adding -t/--timeout 5? i don't like an extra flag like
> that, but the main reason i don't like the -Z5/--sleep=5 requirement is
> that getopt seems to silently swallow the time argument if one does -Z
> 5/--sleep 5; that is, it just pauses and waits for ^C -- and so it may
> appear to a user like the timeout thing is just broken/unimplemented.
You are not doing anything wrong. If the arg to --sleep is
optional, then the 5 in
--sleep 5
must be interpreted as a separate option. You need something
unambiguous like an '=' to say that there really is an arg.
I'm quite comfortable with --sleep=5 for myself.
However having followed the discussion, I really like the idea of
storing info in a file.
Something like:
nfsstat --since=/some/file
where the semantics are:
- load the stats from the kernel (as 'new').
- if /some/file exists and contains stats, load them (as 'old') and
print the difference between 'old' and 'new'.
- write 'new' to /some/file
Then you could
watch -n10 nfsstat --since=/tmp/mystats
to see stats collected over 10second intervals.
(maybe you could have --no-update to inhibit the write...)
I think that would be more useful to scripts even than --sleep=N
Thanks,
NeilBrown
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
prev parent reply other threads:[~2007-08-10 5:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 23:52 [PATCH 0/5] nfsstat: more --diff-stat/--sleep items david m. richter
2007-08-09 1:13 ` Neil Brown
2007-08-09 15:29 ` david m. richter
2007-08-10 5:13 ` Neil Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18107.62467.713097.170392@notabene.brown \
--to=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
--cc=richterd@citi.umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox