You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2007/09/14 20:03:26 UTC

[Lucene-hadoop Wiki] Update of "DevelopmentHints" by OwenOMalley

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-hadoop Wiki" for change notification.

The following page has been changed by OwenOMalley:
http://wiki.apache.org/lucene-hadoop/DevelopmentHints

New page:
= Development Hints =

I wanted a page to put my little framework development hints.

== Server Log Scanning ==

When trying to find how many rpc calls were dropped per a second, I use:

{{{
grep ' discard'  < logfile | sed -e 's/[^ ]* //' -e 's/,.*//' | sort | uniq -c
}}}

When RPCs timeout on the server side, the server dumps the thread stacks, but the stacks have newlines in them so they don't work well with the normal unix tools. So I wrote a little sed script that scans a log file and produces one line for each thread:

{{{
sed -n -e ':start' -e '/^Thread /{h;b inner;}' -e 'd' \
       -e ':inner' -e n -e '/^ /{H;b inner;}' -e '{x;s/\n/ /g;p;x;b start}' < logfile
}}}