{ "info": { "author": "Osman \u00dcng\u00fcr", "author_email": "osmanungur@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: System :: Monitoring" ], "description": "[![Build Status](https://travis-ci.org/o/simmetrica.png?branch=master)](https://travis-ci.org/o/simmetrica)\n\n#Simmetrica (simple-metric-aggregator)\n\nSimmetrica is a lightweight framework for collecting and aggregating event metrics as timeseries data. It also comes with beautiful customizable dashboard for visualizing metrics with charts.\n\n![preview](https://raw.github.com/o/simmetrica/master/preview.png)\n\n###Dependencies\n\n* Python 2.6 or greater\n* Redis Server\n\nMost of the current Linux distributions (also Mac OS X) comes with Python installed default. Simmetrica also uses `redis` for storing data, you can install `redis-server` with your favorite package manager.\n\n###Installing\n\n git clone git://github.com/o/simmetrica.git\n cd simmetrica\n pip install -r requirements.txt\n\n**You need to run `redis-server` before pushing events and querying stored data.**\n\n###How to feed data\n\nWe will use `push` method for notifying our events, it has 3 parameters:\n\nFirst parameter is `event`, which is canonical name of your input data. You'll use this name when querying data and configuring dashboard. Second is `increment`, this optional argument is useful for overriding event count for submitting multiple events in a single operation. Last parameter `now` is defaults to current Unix timestamp, lets you to specify when event occurs.\n\n###How to query data\n\nTo aggreagate stored data, we will use `query` method, it has 4 parameters:\n\nFirst one is `event`, as you guessed, we already used this value for feeding our data. `start` and `end` parameters take Unix timestamp for specifying interval of time-series. This parameters are mandatory. Last parameter `resolution` is used for defining the resolution / granularity of data. This is an optional parameter and it defaults to `5min` (five minutes). Possible values are `min`, `5min`, `15min`, `hour`, `day`, `week`, `month` and `year`.\n\n###Using library\n\n#####Feeding\n\n >>> from simmetrica import Simmetrica\n >>> simmetrica = Simmetrica()\n >>> simmetrica.push('add-cart-action')\n [1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L]\n\nOverriding default parameters:\n\n >>> simmetrica.push('nginx-connections-received-5min', increment=5, now=1364298120)\n\n#####Querying\n\n >>> start = simmetrica.get_current_timestamp() - 600\n >>> end = simmetrica.get_current_timestamp()\n >>> results = simmetrica.query('add-cart-action', start, end, 'min')\n >>> for time, val in results:\n ... print time, val\n ...\n 1364297940 0\n 1364298000 0\n 1364298060 0\n 1364298120 0\n 1364298180 0\n 1364298240 0\n 1364298300 0\n 1364298360 0\n 1364298420 0\n 1364298480 1\n 1364298540 2\n\n###Using command-line\n\n#####Feeding\n\n \u279c python cli.py push add-cart-action\n ok\n\nOverriding default parameters:\n\n \u279c python cli.py push nginx-connections-received-5min --increment=5 --now=1364298120\n\n#####Querying\n\n \u279c python cli.py query add-cart-action 1364297990 1364298608 --resolution=min\n 1364297940 0\n 1364298000 0\n 1364298060 0\n 1364298120 0\n 1364298180 0\n 1364298240 0\n 1364298300 0\n 1364298360 0\n 1364298420 0\n 1364298480 1\n 1364298540 2\n\nBeautify with [spark](http://zachholman.com/spark/)\n\n \u279c python cli.py query add-cart-action 1364297990 1364298608 --resolution=min | awk '{print $2}' | spark\n \u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2584\u2588\n\n###Using REST\n\n#####Feeding\n\nAfter running `app.py`\n\n \u279c curl 127.0.0.1:5000/push/add-cart-action\n ok\n\nOverriding default parameters:\n\n \u279c curl 127.0.0.1:5000/push/nginx-connections-received-5min?increment=5&now=1364298120\n\n#####Querying\n\n \u279c curl \"127.0.0.1:5000/query/add-cart-action/1364297990/1364298608?resolution=min\" | python -mjson.tool\n {\n \"1364297940\": 0,\n \"1364298000\": 0,\n \"1364298060\": 0,\n \"1364298120\": 0,\n \"1364298180\": 0,\n \"1364298240\": 0,\n \"1364298300\": 0,\n \"1364298360\": 0,\n \"1364298420\": 0,\n \"1364298480\": \"1\",\n \"1364298540\": \"2\"\n }\n\n###Overriding redis connection parameters\n\nAs default Simmetrica connects to Redis on `127.0.0.1:6379` with database `0`.\n\n#####In library\n\n >>> from simmetrica import Simmetrica\n >>> simmetrica = Simmetrica(host='192.168.5.30', port=7000, db=16, password=qwerty)\n\n#####In commandline and REST\n\n`redis_host`, `redis_port`, `redis_db` and `redis_password` parameters can be passed as commandline arguments in `app.py` and `cli.py`.\n\n \u279c python cli.py ... --redis_host=192.168.5.30 --redis_port=7000 --redis_db=16 --redis_password=qwerty\n\n###Dashboard\n\n#####Running web application\n\n \u279c python app.py\n * Running on http://127.0.0.1:5000/\n\nNow, you can see your shiny dashboard with pointing your browser to `http://127.0.0.1:5000/`.\n\nOptionally a custom config file can be specified with the `--config` flag.\n\n \u279c python app.py --config myConfig.yml\n\n#####Configuring dashboard blocks\n\nDashboard is configured with `config.yml` file, this file has a yaml list called `graphs`. Graph widgets are rendered with lovely [rickshaw](https://github.com/shutterstock/rickshaw) (HTML5 + SVG and d3.js) library.\n\n graphs:\n - graph definition\n - events\n - graph definition\n - events\n\n##### Explanation of configuration parameters\n\nTypical graph block looks like this:\n\n - title: Title (mandatory)\n timespan: [10 minute, 3 hour, 2 day, 6 week, 1 month or whatever]\n colorscheme: [classic9, colorwheel, cool, munin, spectrum14, spectrum2000, spectrum2001]\n type: [area, stack, bar, line, scatterplot]\n interpolation: [linear, step-after, cardinal, basis]\n resolution: [min, 5min, 15min, hour, day, week, month, year]\n size: [S, M, L, XL]\n offset: [zero, wiggle, expand, value]\n events:\n - name: event_name (mandatory)\n title: Event Title\n\nHere are the explanations:\n\n**title**\n\nTitle of graph block.\n\n\nOptional: No\n\n**timespan**\n\nHow many timespan of data will shown in graph.\n\n\nPossible values: `(NUMBER minute|hour|day|week|month|year)`\n\nOptional: Yes\n\nDefault: `1 day`\n\n**colorscheme**\n\nColorscheme of graph parts.\n\n\nPossible values: `classic9`, `colorwheel`, `cool`, `munin`, `spectrum14`, `spectrum2000` and `spectrum2001`\n\nOptional: Yes\n\nDefault: `colorwheel`\n\n**type**\n\nType of graph.\n\n\nPossible values: `area`, `stack`, `bar`, `line` and `scatterplot`\n\nOptional: Yes\n\nDefault: `area`\n\n**interpolation**\n\nLine smoothing / interpolation method of graphs.\n\n\nPossible values: `linear`, `step-after`, `cardinal` and `basis`\n\nOptional: Yes\n\nDefault: `cardinal`\n\n**resolution**\n\nResolution of values.\n\n\nPossible values: `min`, `5min`, `15min`, `hour`, `day`, `week`, `month`, `year`\n\nOptional: Yes\n\nDefault: `5min`\n\n**size**\n\nSize of graph.\n\n\nPossible values: `S`, `M`, `L` and `XL`\n\nOptional: Yes\n\nDefault: `M`\n\n**offset**\n\nGraph offset base.\n\n\nPossible values: `zero`, `wiggle`, `expand` and `value`\n\nOptional: Yes\n\nDefault: `value`\n\n**events**\n\nEvery graph must have at least one graph definition for rendering. Events have 2 values called `name`, and `title`.\n\n**name**\n\nThis is the name of event, must be given.\n\n**title**\n\nTitle of event, this will be shown in legend and not a mandatory value.\n\n###Contributing\n\nI just created this project for learning some Python. Please help me to make it better!\n\n###License\nCopyright (c) 2013 Osman Ungur\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/o/simmetrica", "keywords": "event,metric,timeseries,statistics", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "simmetrica", "package_url": "https://pypi.org/project/simmetrica/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/simmetrica/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/o/simmetrica" }, "release_url": "https://pypi.org/project/simmetrica/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Library for collecting, aggregating and visualizing event metrics as timeseries data", "version": "1.0.2" }, "last_serial": 1239488, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "16e424cec857947ac91b529d2720a893", "sha256": "524465b1c4ec9574e0016f84cce27be93a97a979d9b98e194224603f3eb9a5a3" }, "downloads": -1, "filename": "simmetrica-1.0.tar.gz", "has_sig": false, "md5_digest": "16e424cec857947ac91b529d2720a893", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7734, "upload_time": "2014-06-25T09:12:39", "url": "https://files.pythonhosted.org/packages/28/bd/fa34a3cfb8fe3e9f0afbc133a116e67945afe768b873dc4dddfc4bda2697/simmetrica-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "9dfea74f3da262cf7644dac05e5e4b5b", "sha256": "759dd8e627e2dab73080788fa8adb07263e28ba8d12242a902a385c4dfc998f1" }, "downloads": -1, "filename": "simmetrica-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9dfea74f3da262cf7644dac05e5e4b5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123859, "upload_time": "2014-07-01T22:35:03", "url": "https://files.pythonhosted.org/packages/c5/c3/7cee8a61ad56db229f6297b3ce52670ec9443fa8c5ab53a9214e0a84b7a9/simmetrica-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "55d721430971bab9d82859a898b22f64", "sha256": "948b2403440c61a3a230074ec9084b4167a6731f2d1a92094f1790571f88d308" }, "downloads": -1, "filename": "simmetrica-1.0.2.tar.gz", "has_sig": false, "md5_digest": "55d721430971bab9d82859a898b22f64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123749, "upload_time": "2014-09-26T20:56:38", "url": "https://files.pythonhosted.org/packages/84/19/82a176620f3bb60e3fe39084f0eb91b85f8a949a599e4258be52d990c583/simmetrica-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55d721430971bab9d82859a898b22f64", "sha256": "948b2403440c61a3a230074ec9084b4167a6731f2d1a92094f1790571f88d308" }, "downloads": -1, "filename": "simmetrica-1.0.2.tar.gz", "has_sig": false, "md5_digest": "55d721430971bab9d82859a898b22f64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123749, "upload_time": "2014-09-26T20:56:38", "url": "https://files.pythonhosted.org/packages/84/19/82a176620f3bb60e3fe39084f0eb91b85f8a949a599e4258be52d990c583/simmetrica-1.0.2.tar.gz" } ] }