<commit_before>graphitesend
============

Easy python bindings to write to Carbon ( Re-write of carbonclient)



Example
-------

Very basic sending of a metric called metric with a value of 45

````python
    >>> import graphitesend
    >>> graphitesend.init()
    >>> graphitesend.send('metric', 45)
    >>> graphitesend.send('metric2', 55)
````

The above would send the following metric to graphite

    system.localhostname.metric 45 epoch-time-stamp
    system.localhostname.metric2 55 epoch-time-stamp


Cleaning up the interface and using a group of cpu to alter the metric prefix

````python
    >>> import graphitesend
    >>> g = graphitesend.init(group='cpu')
    >>> g.send('metric', 45)
    >>> g.send('metric2', 55)
````

The above would send the following metric to graphite

    system.localhostname.cpu.metric 45 epoch-time-stamp
    system.localhostname.cpu.metric2 55 epoch-time-stamp


Using a different prefix (other then system.hostname)

````python
    >>> import graphitesend
    >>> g = graphitesend.init(prefix='apache.rc')
    >>> g.send('404', 4)
    >>> g.send('200', 500)
````

The above would send the following metric to graphite

    apache.rc.404 4 epoch-time-stamp
    apache.rc.200 500 epoch-time-stamp


Sending a dict()

````python
    >>> import graphitesend
    >>> g = graphitesend.init()
    >>> g.send_dict({'metric': 45, 'metric2': 55})
````

installing
----------

*pip*

````sh
$ pip install graphitesend
````

or

*source*

````sh
$ git clone git://github.com/daniellawrence/graphitesend.git
$ cd graphitesend
$ python ./setup.py install
````



Porcelain Overview
==================

init
-----  
Create the module instance of GraphiteSend.

send
-----
Make sure that we have an instance of the GraphiteClient. 
Then send the metrics to the graphite server.

send_dict
---------
Make sure that we have an instance of the GraphiteClient.
Then send the metrics to the graphite server.

reset
-----
Disconnect from the graphite server and destroy the module instance.

<commit_msg>added cli docs<commit_after>graphitesend
============

Easy python bindings to write to Carbon ( Re-write of carbonclient)



Example
-------

Very basic sending of a metric called metric with a value of 45

````python
    >>> import graphitesend
    >>> graphitesend.init()
    >>> graphitesend.send('metric', 45)
    >>> graphitesend.send('metric2', 55)
````

The above would send the following metric to graphite

    system.localhostname.metric 45 epoch-time-stamp
    system.localhostname.metric2 55 epoch-time-stamp


Cleaning up the interface and using a group of cpu to alter the metric prefix

````python
    >>> import graphitesend
    >>> g = graphitesend.init(group='cpu')
    >>> g.send('metric', 45)
    >>> g.send('metric2', 55)
````

The above would send the following metric to graphite

    system.localhostname.cpu.metric 45 epoch-time-stamp
    system.localhostname.cpu.metric2 55 epoch-time-stamp


Using a different prefix (other then system.hostname)

````python
    >>> import graphitesend
    >>> g = graphitesend.init(prefix='apache.rc')
    >>> g.send('404', 4)
    >>> g.send('200', 500)
````

The above would send the following metric to graphite

    apache.rc.404 4 epoch-time-stamp
    apache.rc.200 500 epoch-time-stamp


Sending a dict()

````python
    >>> import graphitesend
    >>> g = graphitesend.init()
    >>> g.send_dict({'metric': 45, 'metric2': 55})
````

installing
----------

*pip*

````sh
$ pip install graphitesend
````

or

*source*

````sh
$ git clone git://github.com/daniellawrence/graphitesend.git
$ cd graphitesend
$ python ./setup.py install
````


cli
------------

Just added -- A cli script that allows for anything to send metrics over to 
graphite (not just python).

The usage is very simple you need to give the command a metric and a value.

````sh
	$ graphitesend name.of.the.metric 666
````

Send more\* then 1 metric and value

````sh
	$ graphitesend name.of.the.metric 666
	$ graphitesend name.of.the.other_metric 2
````

\* Call it 2 times ;)


Porcelain Overview
==================

init
-----  
Create the module instance of GraphiteSend.

send
-----
Make sure that we have an instance of the GraphiteClient. 
Then send the metrics to the graphite server.

send_dict
---------
Make sure that we have an instance of the GraphiteClient.
Then send the metrics to the graphite server.

reset
-----
Disconnect from the graphite server and destroy the module instance.


{'fraction_non_alphanumeric': 0.143849428635447, 'fraction_numerical': 0.023078646650235266, 'mean_word_length': 3.346640701071081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 93, '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': '581205', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1307, 'n_words': 469}