{ "info": { "author": "Kim Gustyr", "author_email": "khvn26@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Topic :: System :: Monitoring", "Topic :: Utilities" ], "description": "rakomon is designed for simplest, most stupid monitoring tasks when logging, caching, etc. isn't required.\nIt simply encapsulates some of tornado and apscheduler functionality to run simple tasks periodically, store results in memory and serve them in application/json.\nYou can use both monitor and endpoint modules to serve your metrics automagically, or instantiate the `monitor.Monitor` class on your own to use it however you see fit. \n\n### Disclaimer: though I use this code in my projects, it's rather raw. I set up this repository mainly to learn how to maintain an open-source project. It's up to you to evaluate if rakomon is production ready. \n\n# Dependencies\nrakomon is Python 3 only. It also requires tornado and apscheduler.\n\n# Installation\nUse pip:\n```sh\n$ pip install rakomon\n```\nOr clone repository to your machine and use easy_install:\n```sh\n$ easy_install setup.py\n```\n\n# Basic usage\nrakomon is ready out of the box. All you need is get default `Monitor` instance, then define your metrics as functions and decorate them with the `Monitor.metric` decorator.\nA metric function should return either a number or a string. Iterables support is planned for future. \nAfter you define your metrics, call `endpoint.run()` to launch a simple tornado server to serve them. It will bind to port 80 on localhost by default.\n```python\nimport psutil\n\nfrom rakomon import monitor, endpoint\n\nm = monitor.default()\n\n@m.metric\ndef cpu():\n return psutil.cpu_percent(interval=1)\n\n@m.metric\ndef ram():\n return psutil.virtual_memory().percent\n\nendpoint.run()\n```\n```sh\n$ curl http://127.0.0.1/rakomon\n{\"cpu\": 2.3, \"ram\": 33.1}\n```\n\n# Configuration\nBoth `monitor.Monitor` and `endpoint.run` are configurable. You can pass configuration as keyword arguments. If kwargs are not provided, rakomon uses default values.\n\n## monitor.Monitor\n* `scheduler` - a class that inherits from `apscheduler.schedulers.base.BaseScheduler`. Useful when you want to utilize Monitor on its own, without the included endpoint. See [apscheduler docs](http://apscheduler.readthedocs.io) for more info on schedulers. Defaults to `TornadoScheduler`. \n* `metric_interval` - number of idle seconds between metric runs. Defaults to `5`.\n* `round_ndigits` - number of digits when rounding metric values. Naturally, applies to number values only. Defaults to `2`.\n\n## endpoint.run\n* `monitor` - an instance of `monitor.Monitor`. Defaults to `monitor.default()`.\n* `address` - address to bind the tornado endpoint to. Defaults to `'127.0.0.1'`.\n* `port` - port to bind the tornado endpoint to. Defaults to `80`.\n* `url_path` - defaults to `r'/rakomon'`.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/khvn26/rakomon", "keywords": "simple stupid monitoring", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "rakomon", "package_url": "https://pypi.org/project/rakomon/", "platform": "", "project_url": "https://pypi.org/project/rakomon/", "project_urls": { "Homepage": "https://github.com/khvn26/rakomon" }, "release_url": "https://pypi.org/project/rakomon/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Dead simple, configurable monitoring service based on tornado and apscheduler.", "version": "0.1.2" }, "last_serial": 2758142, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "4c1f8291a0569d2dd15e3f78d626d191", "sha256": "977476dc634fdc860f952cfd97a979be201deb3a54006254ec0cace4ce443294" }, "downloads": -1, "filename": "rakomon-0.1.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "4c1f8291a0569d2dd15e3f78d626d191", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5086, "upload_time": "2017-04-06T15:36:58", "url": "https://files.pythonhosted.org/packages/53/e4/4354278d01adfb130d417db0660f3b2fcab4e1551cf4aa4e0aa901b33b77/rakomon-0.1.2.linux-x86_64.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c1f8291a0569d2dd15e3f78d626d191", "sha256": "977476dc634fdc860f952cfd97a979be201deb3a54006254ec0cace4ce443294" }, "downloads": -1, "filename": "rakomon-0.1.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "4c1f8291a0569d2dd15e3f78d626d191", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5086, "upload_time": "2017-04-06T15:36:58", "url": "https://files.pythonhosted.org/packages/53/e4/4354278d01adfb130d417db0660f3b2fcab4e1551cf4aa4e0aa901b33b77/rakomon-0.1.2.linux-x86_64.tar.gz" } ] }