Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Easy python bindings to write to Carbon (frontend for Graphite's Whisper storage format)
branch: master

This branch is 5 commits behind daniellawrence:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
carbonclient.py

README

Simple python code that allows a connection to a carbon-cache sever for graphite.
This can be used as a python library or a standalone executeable.

from the command line...

	./carbonclient.py -m filesystem._root -v 53
	./carbonclient.py -c cabonserver.example.com -p 2003 -g prodcution -s myservername -m df_root -v 53
	./carbonclient.py -c cabonserver.example.com -p 2003 -g prodcution -s myservername -m df_root -v $( df -k / | awk '{print $5}' | sed 's/[^0-9]//g' | tail -1 )

from python - single update

	>>> from carbonclient import update
	>>> update(metric="filesystem._root", value=53)
	>>> update(server="cabonserver.example.com", port=2003, group="production", metric="filesystem._root", value=53)
	>>> update(server="cabonserver.example.com", port=2003, group="production", metric="filesystem._root", value=get_df('/'))


from python - bulk update: This takes a dictonary then cuts it up into updates of 500 and submits it as a multiline updater

    >>> from carbonclient import bulkupdate
	>>> data={'metric_name1': 123, 'metric_name2': 456, 'metric_name3': 789, 'metric_nameN': 1234}
	>>> bulkupdate(server="carbon.example.com", port=2003, group="production", data=data)
Something went wrong with that request. Please try again.