{ "info": { "author": "Christian Wyglendowski", "author_email": "christian@dowski.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries", "Topic :: System :: Monitoring" ], "description": "statvent\n==========\n\nstatvent gives you three things:\n\n1. A developer API for recording metrics in your library or application.\n2. A deployer API that writes stats to a named pipe.\n3. A simple web service that will read from *all* named pipes on a host and\n serve the results as JSON.\n\nThe Developer API\n=================\n\nIt's really simple. There are three functions for recording data.\n\n``statvent.incr(name, value=1)``\n\n Call it with the ``name`` of a stat and it will increment it. If it doesn't\n exist yet, it will initialize it to the given ``value`` (defaults to\n ``1``).\n\n It's very useful for keeping tabs on events that happen within your apps.\n\n``statvent.set(name, value)``\n\n Call it with the ``name`` of a stat and a value. The stat will be set to\n that value.\n\n This function is useful for values that can fluctuate, like number of\n concurrent users, connections to a database, winning streaks, etc.\n\n``statvent.record(name, value, format_func=str.format)``\n\n Call it with the ``name`` of a stat and a value. By default the ``name``\n must include a ``{0}`` format placeholder. Internally, the value is\n appended to a deque. When the pipe is read, the stats recorder will\n calculate some aggregate statistics from the contents of the deque\n (by default a few percentile breaks and the mean).\n \n **If your stat name scheme conflicts with the default ``str.format``\n function you can provide your own function to format the stat name to\n include the calculated percentile labels.**\n\nThe names of stats just need to be byte strings. You can format them however\nyou want, include whatever punctuation makes you happy, etc. If you want\npercentiles or other calculated stats (using ``statvent.record``), you'll need\nto take a bit of extra care when formatting your stat names.\n\nValues can be integers or floats. Be aware that once you use a float, that stat\nwill remain a float. It probably doesn't matter that much, but now you know.\n\nThe Deployer API\n================\n\nNotice that there is no mention of an API for reading stats. That's because the\ncreation and consumption of your application's metrics should be decoupled. The\ndecoupling is accomplished by writing the data out to a named pipe.\n\n``statvent.start_recorder()``\n\n Starts a thread that writes the application stats to a named pipe.\n\n The thread blocks on the open system call won't spend any of your\n application's resources until another process opens the pipe for reading.\n\nThe Named Pipe\n--------------\n\nBy default the pipes are located in ``/tmp/stats-pipe/`` and are named\n``.stats`` where ```` is the UNIX process ID that is writing data\ninto that named pipe. You can change the location where pipes are\nwritten/read by setting the ``statvent.stats.config['pipe_dir']`` path. Make\nsure your processes have permission to write there though.\n\nEach stat is written to its own line in the named pipe. The name of the\nstat and the current value are separated by a colon `:` followed by a\nspace. The value follows and is either a floating point value or an integer\nvalue. Then there is a newline character. Here's an example::\n\n a.b.c.d: 42\n My Nice Stat: 123.45\n another[one]: 0\n\nYou can peek at the current state of your app by running ``cat`` against the\nnamed pipe, or have a process that does that regularly and inserts the results\ninto a database to track the data over time.\n\nThe Web Service\n===============\n\nIf you don't want to mess with consuming a weird plain-text format like you get\nfrom the named pipe, and you want to collect stats from more than one process\non a host, the JSON web service might interest you.\n\nIt will sum the values of all stats and serve them up as JSON. Try running\n``python -m statvent.web`` as a script to see it in action.", "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/dowski/statvent/", "keywords": "monitoring stats statistics counters pipe", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "statvent", "package_url": "https://pypi.org/project/statvent/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/statvent/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dowski/statvent/" }, "release_url": "https://pypi.org/project/statvent/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "A simple library that writes stats about your program to a named pipe.", "version": "1.0.1" }, "last_serial": 800108, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "87fd67269f20697d4ec970053f89e3f7", "sha256": "f9f6420b3f874bce72c37ca53412c1c5fb2249694ab679e8add2c2214d6b7ad9" }, "downloads": -1, "filename": "statvent-1.0.0.tar.gz", "has_sig": false, "md5_digest": "87fd67269f20697d4ec970053f89e3f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5557, "upload_time": "2013-03-16T05:02:50", "url": "https://files.pythonhosted.org/packages/67/c3/15b37f4120a1fe6c27d2e6052451146a6e47bb8cf1ecdba9f14f2a769687/statvent-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "58ef2aae95db8f5bd6fa6dc9d0f0c55d", "sha256": "a15445b6c77d9efa9d1388316787cfc6e479bfcf54c2d61d55331f0418d31e77" }, "downloads": -1, "filename": "statvent-1.0.1.tar.gz", "has_sig": false, "md5_digest": "58ef2aae95db8f5bd6fa6dc9d0f0c55d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6172, "upload_time": "2013-03-27T18:47:17", "url": "https://files.pythonhosted.org/packages/40/b2/1a51c12fd252e12fb3fa63ce6928320669ed2720d33c23b50d77738ded49/statvent-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "58ef2aae95db8f5bd6fa6dc9d0f0c55d", "sha256": "a15445b6c77d9efa9d1388316787cfc6e479bfcf54c2d61d55331f0418d31e77" }, "downloads": -1, "filename": "statvent-1.0.1.tar.gz", "has_sig": false, "md5_digest": "58ef2aae95db8f5bd6fa6dc9d0f0c55d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6172, "upload_time": "2013-03-27T18:47:17", "url": "https://files.pythonhosted.org/packages/40/b2/1a51c12fd252e12fb3fa63ce6928320669ed2720d33c23b50d77738ded49/statvent-1.0.1.tar.gz" } ] }