<commit_before># Riak Query Sniffer

## Description

This program uses libpcap to capture and analyze packets destined for
a Riak server.  With a variety of command line options, you can tune
the output to show you a variety of outputs to help diagnose what your
clients are doing.

There are other options useful for tuning the output to your
specifications.  Please see the application help and play with it.


## Examples

To give you a visual diagram, this is what it looks like when run on
a hypothetical machine. Note that you can run this script on a Riak
machine or on your application node depending on what you want to
analyze.

    $ sudo ./riak-sniffer  
    Initializing Riak sniffing on eth0:8087...

    2012/05/04 18:28:10 701 total queries, 63.73 per second
        7  0.64/s  get obj:\xf3\xa4\x99<commit_msg>Better description<commit_after># Riak Query Sniffer

## Description

This program uses libpcap to capture and analyze packets destined for
a Riak server that is using the protobuf API. This tool helps diagnose
what queries are being sent to your database.

Read on to see some examples of what this tool can tell you.


## Examples

To give you a visual diagram, this is what it looks like when run on
a hypothetical machine. Note that you can run this script on a Riak
machine or on your application node depending on what you want to
analyze.

    $ sudo ./riak-sniffer  
    Initializing Riak sniffing on eth0:8087...

    2012/05/04 18:28:10 701 total queries, 63.73 per second
        7  0.64/s  get obj:\xf3\xa4\x99
{'fraction_non_alphanumeric': 0.04521963824289406, 'fraction_numerical': 0.04392764857881137, 'mean_word_length': 3.4257142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2667462', 'n_tokens_mistral': 490, 'n_tokens_neox': 423, 'n_words': 239}