<commit_before>Zibrato
==========

Zibrato provides a decorator that records metrics for a function. The metrics 
go first to a local ZeroMQ and then to Librato. Other backends such as statsd
are contemplated for the future.

Usage
-----

Zibrato consists of two parts. First, it provides the zibrato module used for
instrumenting code.

@count_me('counter_name')
  Increment a counter named 'counter_name' each time the decorated function
  is called.

Count_me('counter_name', interval = 1)
  Increment a counter named 'counter_name'. To increment by an interval other
  than one, set interval to the amount.

@time_me('timer_name')
  Record the decorated function's execution time under a gauge named
  'timer_name'.

Time_me('timer_name')
  Record the time spent within a given context.
  
  Example::
    import zibrato
    ...
    with Time_me('timer_name'):
      pass

Zibrato also includes a worker that processes queued messages and sends them to Librato.

Example::
  python /usr/local/lib/python2.7/dist-packages/zibrato/workers/librato.py --username USERNAME --apikey KEY

Alternatively, the worker can be run from supervisord::
  [program:zibrato_librato]
  command=python /usr/local/lib/python2.7/dist-packages/zibrato/workers/librato.py --username USERNAME --apikey KEY
  process_name=%(program_name)s
  autostart=true
  autorestart=true
  stopsignal=QUIT
  user=www-data

Options::
  --username  Librato username
  --apikey    Librato API key
  --hostname  Librato hostname, defaults to "metrics-api.librato.com"
  --apipath   Librato path, defaults to "/v1/"
<commit_msg>Layout revisions to readme<commit_after>Zibrato
==========

Zibrato provides a decorator that records metrics for a function. The metrics 
go first to a local ZeroMQ and then to Librato. Other backends such as statsd
are contemplated for the future.

Usage
-----

Zibrato consists of two parts. First, it provides the zibrato module used for
instrumenting code.

@count_me('counter_name')

  Increment a counter named 'counter_name' each time the decorated function
  is called.

Count_me('counter_name', interval = 1)

  Increment a counter named 'counter_name'. To increment by an interval other
  than one, set interval to the amount.

@time_me('timer_name')

  Record the decorated function's execution time under a gauge named
  'timer_name'.

Time_me('timer_name')

    Record the time spent within a given context.
  
    Example::

      import zibrato
      ...
      with Time_me('timer_name'):
        pass

Zibrato also includes a worker that processes queued messages and sends them to Librato.

Example::

    python /usr/local/lib/python2.7/dist-packages/zibrato/workers/librato.py --username USERNAME --apikey KEY

Alternatively, the worker can be run from supervisord::

    [program:zibrato_librato]
    command=python /usr/local/lib/python2.7/dist-packages/zibrato/workers/librato.py --username USERNAME --apikey KEY
    process_name=%(program_name)s
    autostart=true
    autorestart=true
    stopsignal=QUIT
    user=www-data

Options::

    --username  Librato username
    --apikey    Librato API key
    --hostname  Librato hostname, defaults to "metrics-api.librato.com"
    --apipath   Librato path, defaults to "/v1/"

{'fraction_non_alphanumeric': 0.08469860896445132, 'fraction_numerical': 0.0037094281298299847, 'mean_word_length': 3.7309941520467835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '280898', 'n_tokens_mistral': 1009, 'n_tokens_neox': 990, 'n_words': 345}