{ "info": { "author": "Rob Martin @version2beta", "author_email": "rob@version2beta.com", "bugtrack_url": null, "classifiers": [], "description": "Zibrato\n==========\n\nZibrato provides Python decorators and context managers that instrument code.\nIt attempts to do this very efficiently, so the metrics are collected and\nthen shifted into a ZeroMQ queue, where a backend process can collect them\nand send them to Librato. Other backends such as statsd are contemplated for\nthe future.\n\nInstallation\n------------\n\nZibrato is available through PyPi at http://pypi.python.org/pypi/Zibrato/.\n\nAlternatively, one should be able to clone the github repository at\nhttps://github.com/Version2beta/zibrato and run pip install the\nrequirements.txt file.\n\nPlease note that pyzmq is an installation prerequisite. Ubuntu users (and\nprobably others) will need the python-dev package installed in order to build\npyzmq::\n\n sudo apt-get install python-dev\n\nTo run tests, you'll also need Python nose and Gary Bernhardt's expecter\npackage::\n pip install nose expecter\n\nUsage\n-----\n\nZibrato consists of two parts. First, it provides the zibrato module used for\ninstrumenting code.\n\nZibrato module\n______________\n\nfrom zibrato import Zibrato\n Librato, Backend, and Broker modules also available. See code.\n\nz = Zibrato()\n Set up a new instance of Zibrato to use in your code. Accepts several\n settings:\n\n * host: The FQDN or IP address with which to connect. Optional.\n Defaults to '127.0.0.1'. See \"Zibrato workers\" below.\n * port: The port with which to connect. Optional. Defaults to 5550.\n * context: A ZeroMQ context instance. This is completely optional and\n only desirable under advanced circumstances where ZeroMQ is being\n used in other ways, too.\n\n@z.count_me(level = 'info', name = 'counter_name')\n Increment a counter named 'counter_name' each time the decorated function\n is called.\n\nz.Count_me(level = 'info', name = 'counter_name', value = 4)\n Increment a counter named 'counter_name'. To increment by an interval other\n than one, set value to the amount.\n\n@z.time_me(level = 'debug', name = 'timer_name')\n Record the decorated function's execution time under a gauge named\n 'timer_name'.\n\nz.Time_me(level = 'debug', name = 'timer_name')\n Record the time spent within a given context.\n \nz.gauge(level = 'crit', name = 'gauge_name', value=123)\n Record a value.\n\nZibrato decorators, of course, return the result of the wrapped function.\nContext managers return None as they are not intended to be used from within\nthe 'with' block. The gauge method returns None also.\n\nMetric decorators and context managers take up to four arguments:\n\n* level: Required. Monitoring level, modeled after logging levels (i.e.\n debug, info, warning, error, critical) but completely arbitrary so you\n can use whatever labels work for you. Zibrato workers are configured to\n pay attention to only specified levels.\n* mtype: Required. Type of metric, typically 'counter', 'timer', and\n 'gauge'. See \"Metric types\" below.\n* name: Required. Name of the metric being recorded.\n* value: Value to record. For timing functions, value is neither required\n nor desirable to provide, and if provided it will be replaced by the\n measured time. For counters, value represents the quantity by which the\n counter should be incremented, and defaults to 1 if not provided. For\n gauges, this is the fixed reading and should be provided.\n* source: The source of the metric. This might represent the name of the\n program, class, or server for instance. Optional and defaults to\n 'not_specified'.\n\nExample code::\n\n import zibrato\n z = Zibrato()\n # or z = Zibrato(host = '127.0.0.1', port = '5550')\n ...\n @z.time_me(level = 'debug', name = 'myfunct_timer', source = 'myprog')\n def myfunctt():\n time_consuming_operations()\n ...\n @z.count_me(level = 'info', name = \"myfunct_counter', value = 5) # inc by 5\n def myfunctc():\n pass\n ...\n with z.Count_me(level = 'info', name = 'counter_name', source = 'deathstar'):\n pass\n ...\n with z.Time_me(level = 'debug', name = 'timer_name'):\n slow_function_to_time()\n ...\n z.gauge(level = 'crit', name = 'gauge_name', value=123)\n\nZibrato workers\n_______________\n\nZibrato requires a broker that connects one or more publishers\nof measurements (source code being run in parallel) to one or\nmore measurement backends (Librato and Statsd, for example.)\n\nThe Zibrato broker\n++++++++++++++++++\n\nThe Zibrato broker runs as a daemon under supervisord or other process\ncontroller. It provides a TCP endpoint for the Zibrato publishers (code\ninstruments) to send measurements, and a TCP endpoint to which the Zibrato\nbackends can subscribe to get measurements for sending off to other services.\n\nThe broker might be started like this::\n\n /usr/bin/librato-broker --host 127.0.0.1 --port 5550\n\nwhere 'host' specifies the IP address or FQDN and 'port' specifies the lower\nport of a consecutive pair to which the broker should bind. Both host and port\nare optional. Default values are 127.0.0.1 and 5550, respectively. The lower\nport address is used to listen to Zibrato publishers (see 'Zibrato module'\nabove) and the higher port is used to publish to Zibrato workers (see 'Zibrato\nworkers' below).\n\nThe preferred way to start the Zibrato backend would be to use a service such\nas supervisord::\n\n [program:zibrato-broker]\n command=/usr/bin/zibrato-broker --host 127.0.0.1 --port 5550\n process_name=%(program_name)s\n autostart=true\n autorestart=true\n stopsignal=QUIT\n user=www-data\n\nZibrato workers\n+++++++++++++++\n\nThis version of Zibrato also includes a worker that processes queued\nmeasurements and sends them to Librato.\n\nExample::\n\n python /usr/bin/zibrato-librato --username USERNAME --apitoken KEY \\\n --levels test,debug,info --flush 60\n\nThe available parameters are:\n\n* --host: The FQDN hostname or IP address of the Zibrato backend.\n* --port: The port to which the Zibrato work should connect. This is the\n higher of the two ports in the pair, and one greater than the port\n specified when starting the backend.\n* --levels: The levels to which this worker should subscribe.\n* --flush: The frequency with which the measurements should be sent to\n Librato.\n* --username: The Librato username for connecting to their API.\n* --apitoken: The Librato API Token for connecting to their API.\n\nAlternatively, the worker can be run from supervisord::\n\n [program:zibrato-librato]\n command=python /usr/bin/zibrato-librato --username USERNAME \\\n --apitoken KEY --levels info,warn --flush 60\n process_name=%(program_name)s\n autostart=true\n autorestart=true\n stopsignal=QUIT\n user=www-data\n\nCreating a new Zibrato worker\n+++++++++++++++++++++++++++++\n\nNew Zibrato backend workers should subclass the Backend class specified in\nzibrato/backend.py. They probably need to reimplement the connect, parse,\npost, and flush methods, and must include code for running as __main__. See\nzibrato/librato.py as an example.\n\nThe setup.py script contains an \"entry_points\" section for defining console\nscripts. The preferred implementation of an additional worker will be to name\nit following the \"zibrato-service\" pattern and add it to the console_scripts\narray.\n\nMetric types\n____________\n\n* Counters. Zibrato counters keep track of how many times an event with\n a common name happens between two flushes on the back end. So for\n example, let's say you're keeping track of how may times 'myfunct' is\n called, and you're flushing your data to the back end every 60 seconds.\n If you don't specify a value, then the 'myfunct_counter' will be\n incremented by one each time the counter is encountered, sent to Librato\n and reset to zero every 60 seconds. If source is specified, the counter\n uniquely tracked by source and name, rather than just name. The\n timestamp for a counter is given as the time the counter is flushed.\n* Gauges. Gauges hold a value at a given time. Each gauge measurement\n is recorded to the backend with a timestamp for the time Zibrato\n received the measurement.\n* Timers. Zibrato provides a special gauge that it fills in automatically\n with the amount of time something took. Time is measured in seconds to\n microsecond resolution using Python's datetime.now() method.\n\nPlease note that the Zibrato backend is ultimately responsible for\nimplementing how each metric type is recorded. In this release only one\nbackend is provided, but in future releases check with the backend\ndocumentation to determing exactly how a metric behaves.\n\nPlease also note that Zibrato was originally written to provide code\ninstrumentation specifically and to connect to Librato specifically. This\nintroduces an impedence mismatch, as Librato's availble metric types as of\nthis writing are limited to gauges and counters, and Librato's counters\ndon't work the way we need our counters to work. So the metrics implemented\nin this code translate into only gauges at Librato.\n\nOther business\n--------------\n\nTests\n_____\n\nZibrato includes nose tests in the tests/ directory.\n\nPull requests\n_____________\n\nPull requests are welcome!\n\nThank you\n_________\n\nSpecial thanks to Tracy Harms @kaleidic who coached me on Agile methodologies\nand test driven development, plus helped tease out the intricasies of ZeroMQ\nand the architecture of this program.\n\nThanks too to Gary Bernhardt @garybernhardt for the expecter library, and for\nhelping Tracy and I figure out how to translate Ruby TDD experience into\nPython.\n\nAlso, thank you to regulars on #zeromq who answered beginner questions\npatiently.\n\nLicense\n_______\n\nZibrato is released under a 3-clause BSD license, which can be read in the\nLICENSE.txt file.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/zibrato/", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "Zibrato", "package_url": "https://pypi.org/project/Zibrato/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Zibrato/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/zibrato/" }, "release_url": "https://pypi.org/project/Zibrato/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Send metrics to Librato via ZeroMQ.", "version": "0.2.0" }, "last_serial": 786079, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a324c3967a6cf94209e1e94059a664b4", "sha256": "cfd297ecdc13994b969cee079db7a16276582e7a15da420da43be032baa71245" }, "downloads": -1, "filename": "Zibrato-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a324c3967a6cf94209e1e94059a664b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12520, "upload_time": "2013-01-08T19:59:37", "url": "https://files.pythonhosted.org/packages/43/a3/9320b6b03d9135b719f540764a7fdb293c51810f7f78795c577211e421b7/Zibrato-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5ecc4e95e86a67545b941a201278d265", "sha256": "1a7c4607ebc29fdb42757132ee35792ab16853bfabda3a722e4c485cd8afbcc5" }, "downloads": -1, "filename": "Zibrato-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5ecc4e95e86a67545b941a201278d265", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12521, "upload_time": "2013-01-08T20:12:23", "url": "https://files.pythonhosted.org/packages/2d/5b/82204b579d558b0d7ccfe52dd412f7427b64c7969bbba025dabac08500a8/Zibrato-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d679c3af6ccfa5110070f86d56d0c2bd", "sha256": "5e3ae29f7d3f94757210a9005bd90d75c120c96a276b75a437d774b7eef6725d" }, "downloads": -1, "filename": "Zibrato-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d679c3af6ccfa5110070f86d56d0c2bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12915, "upload_time": "2013-01-08T20:43:46", "url": "https://files.pythonhosted.org/packages/84/b3/7ef521c5170c57e45aa39006a0c0f6f27ddbc3482b2ac507d2b9833d0f7f/Zibrato-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "107ccc9dc3eb8b27ea2a1f59ca5dc819", "sha256": "4981488946dddc3c41db0b89ac233a3861af3e333b4bb64ccca63718cb1b06d3" }, "downloads": -1, "filename": "Zibrato-0.1.3.tar.gz", "has_sig": false, "md5_digest": "107ccc9dc3eb8b27ea2a1f59ca5dc819", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13206, "upload_time": "2013-01-08T20:54:16", "url": "https://files.pythonhosted.org/packages/97/8f/3e154b4a9f78f8bd853694db8ae41ece8fcffd147dd9b4d829e7d8bebb41/Zibrato-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8c516191fa664ba356b344bdcb6a78f3", "sha256": "275562757834d8d9046438ddca811a24fb7a7225c1cb3f6cfc330880a1eef4b4" }, "downloads": -1, "filename": "Zibrato-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8c516191fa664ba356b344bdcb6a78f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13221, "upload_time": "2013-01-08T20:58:07", "url": "https://files.pythonhosted.org/packages/5a/8b/374a39791fb6bcec6722c404c20a3e0cdcf98d83413f1ea73d01e27dd82b/Zibrato-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "30b8b784351ebe2e17c75064ab287555", "sha256": "6e6b13c41d78ebe84d69276c9c390d4faad30ac47ae492163fef92d835bf3880" }, "downloads": -1, "filename": "Zibrato-0.1.5.tar.gz", "has_sig": false, "md5_digest": "30b8b784351ebe2e17c75064ab287555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13187, "upload_time": "2013-01-08T21:57:50", "url": "https://files.pythonhosted.org/packages/37/8e/2cf7d85a9dbe5675c2147cf39ac4c162492e06f5153477d2bcf2fabaeb68/Zibrato-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "9c15c79216e5942757b7a4bf97a4690d", "sha256": "53f57cbe9d34928b6bebfaac91d4402f4a4dea955c1b5e181ff8eb4c339d2911" }, "downloads": -1, "filename": "Zibrato-0.1.6.tar.gz", "has_sig": false, "md5_digest": "9c15c79216e5942757b7a4bf97a4690d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13250, "upload_time": "2013-01-08T22:10:32", "url": "https://files.pythonhosted.org/packages/08/36/93962164cd59be785b6bb97f5ad424d596c54acda0ca533fdc6d7bf10e4a/Zibrato-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "1aff322aa2c5d0118451679dcbceaccf", "sha256": "8fd87144d071c21b2b1b6daf105159d00b394b10c86095a9ef40d472abf3cbd7" }, "downloads": -1, "filename": "Zibrato-0.1.7.tar.gz", "has_sig": false, "md5_digest": "1aff322aa2c5d0118451679dcbceaccf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13262, "upload_time": "2013-01-08T23:10:12", "url": "https://files.pythonhosted.org/packages/28/e9/dde1996f59a74dbcca1465c5380aae24a3a9b9609959a677be913662e6a3/Zibrato-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "73f88f8a3e0ab6b73ac09dfde37345ad", "sha256": "8e8e4b7e530631aadcd48375c37c7b3edd77aa52e2a86e8a32ceee2179baf3d9" }, "downloads": -1, "filename": "Zibrato-0.2.0.tar.gz", "has_sig": false, "md5_digest": "73f88f8a3e0ab6b73ac09dfde37345ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13593, "upload_time": "2013-03-25T19:25:24", "url": "https://files.pythonhosted.org/packages/bf/0f/cba2405d8d1381f3d8c74479ed1e790a28eeafcc6399fa000d0094f8640e/Zibrato-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73f88f8a3e0ab6b73ac09dfde37345ad", "sha256": "8e8e4b7e530631aadcd48375c37c7b3edd77aa52e2a86e8a32ceee2179baf3d9" }, "downloads": -1, "filename": "Zibrato-0.2.0.tar.gz", "has_sig": false, "md5_digest": "73f88f8a3e0ab6b73ac09dfde37345ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13593, "upload_time": "2013-03-25T19:25:24", "url": "https://files.pythonhosted.org/packages/bf/0f/cba2405d8d1381f3d8c74479ed1e790a28eeafcc6399fa000d0094f8640e/Zibrato-0.2.0.tar.gz" } ] }