procstat


Nameprocstat JSON
Version 0.0.8 PyPI version JSON
download
home_page
SummaryTool to count runtime metrics
upload_time2023-08-11 07:24:35
maintainer
docs_urlNone
author
requires_python>=3.8
licenseThe MIT License (MIT) Copyright (c) 2021-2023, Gregory Petukhov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords stat stats statistics metrics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Procstat Documentation

[![Tests Status](https://github.com/lorien/procstat/actions/workflows/test.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/test.yml)
[![Code Quality Status](https://github.com/lorien/procstat/actions/workflows/check.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/test.yml)
[![Types Check Status](https://github.com/lorien/procstat/actions/workflows/mypy.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/mypy.yml)
[![Test Coverage Status](https://coveralls.io/repos/github/lorien/procstat/badge.svg)](https://coveralls.io/github/lorien/procstat)
[![Documentation Status](https://readthedocs.org/projects/procstat/badge/?version=latest)](http://user-agent.readthedocs.org)

This library helps to count runtime metrics. For specific events you increment manually the
corresponding counters. By default the library dumps all counters into stderr each 3 seconds.
It also can display the speed of metric is changing.

It also can dump metrics into influxdb, will be documented later, see source code for details.

# Installation

```shell
pip install -U procstat
```

# Usage

```python
import time
from procstat import Stat

stat = Stat(speed_keys=['foo', 'bar'])
while True:
    stat.inc('foo') # default increment is 1
    stat.inc('bar', 100)
    stat.inc('baz', 500)
    time.sleep(1)
```

That code will produce output like:
```
DEBUG:procstat:EPS: bar: 0.0, foo: 0.0 | TOTAL:
DEBUG:procstat:EPS: bar: 1.0, foo: 0.0+ | TOTAL: bar: 40, baz: 80, foo: 4
DEBUG:procstat:EPS: bar: 2.0, foo: 0.0+ | TOTAL: bar: 70, baz: 140, foo: 7
DEBUG:procstat:EPS: bar: 3.0, foo: 0.0+ | TOTAL: bar: 100, baz: 200, foo: 10
DEBUG:procstat:EPS: bar: 4.0, foo: 0.0+ | TOTAL: bar: 130, baz: 260, foo: 13
DEBUG:procstat:EPS: bar: 5.0, foo: 0.0+ | TOTAL: bar: 160, baz: 320, foo: 16
DEBUG:procstat:EPS: bar: 6.0, foo: 0.0+ | TOTAL: bar: 190, baz: 380, foo: 19
DEBUG:procstat:EPS: bar: 7.0, foo: 0.0+ | TOTAL: bar: 220, baz: 440, foo: 22
DEBUG:procstat:EPS: bar: 8.0, foo: 0.0+ | TOTAL: bar: 250, baz: 500, foo: 25
DEBUG:procstat:EPS: bar: 9.0, foo: 0.0+ | TOTAL: bar: 280, baz: 560, foo: 28
DEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 310, baz: 620, foo: 31
DEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 340, baz: 680, foo: 34
DEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 370, baz: 740, foo: 37
...
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "procstat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "stat,stats,statistics,metrics",
    "author": "",
    "author_email": "Gregory Petukhov <lorien@lorien.name>",
    "download_url": "https://files.pythonhosted.org/packages/2c/17/f98b2a67926c5eabc43f7669c642844109c90d652572f1a8b80b306c6959/procstat-0.0.8.tar.gz",
    "platform": null,
    "description": "# Procstat Documentation\n\n[![Tests Status](https://github.com/lorien/procstat/actions/workflows/test.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/test.yml)\n[![Code Quality Status](https://github.com/lorien/procstat/actions/workflows/check.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/test.yml)\n[![Types Check Status](https://github.com/lorien/procstat/actions/workflows/mypy.yml/badge.svg)](https://github.com/lorien/procstat/actions/workflows/mypy.yml)\n[![Test Coverage Status](https://coveralls.io/repos/github/lorien/procstat/badge.svg)](https://coveralls.io/github/lorien/procstat)\n[![Documentation Status](https://readthedocs.org/projects/procstat/badge/?version=latest)](http://user-agent.readthedocs.org)\n\nThis library helps to count runtime metrics. For specific events you increment manually the\ncorresponding counters. By default the library dumps all counters into stderr each 3 seconds.\nIt also can display the speed of metric is changing.\n\nIt also can dump metrics into influxdb, will be documented later, see source code for details.\n\n# Installation\n\n```shell\npip install -U procstat\n```\n\n# Usage\n\n```python\nimport time\nfrom procstat import Stat\n\nstat = Stat(speed_keys=['foo', 'bar'])\nwhile True:\n    stat.inc('foo') # default increment is 1\n    stat.inc('bar', 100)\n    stat.inc('baz', 500)\n    time.sleep(1)\n```\n\nThat code will produce output like:\n```\nDEBUG:procstat:EPS: bar: 0.0, foo: 0.0 | TOTAL:\nDEBUG:procstat:EPS: bar: 1.0, foo: 0.0+ | TOTAL: bar: 40, baz: 80, foo: 4\nDEBUG:procstat:EPS: bar: 2.0, foo: 0.0+ | TOTAL: bar: 70, baz: 140, foo: 7\nDEBUG:procstat:EPS: bar: 3.0, foo: 0.0+ | TOTAL: bar: 100, baz: 200, foo: 10\nDEBUG:procstat:EPS: bar: 4.0, foo: 0.0+ | TOTAL: bar: 130, baz: 260, foo: 13\nDEBUG:procstat:EPS: bar: 5.0, foo: 0.0+ | TOTAL: bar: 160, baz: 320, foo: 16\nDEBUG:procstat:EPS: bar: 6.0, foo: 0.0+ | TOTAL: bar: 190, baz: 380, foo: 19\nDEBUG:procstat:EPS: bar: 7.0, foo: 0.0+ | TOTAL: bar: 220, baz: 440, foo: 22\nDEBUG:procstat:EPS: bar: 8.0, foo: 0.0+ | TOTAL: bar: 250, baz: 500, foo: 25\nDEBUG:procstat:EPS: bar: 9.0, foo: 0.0+ | TOTAL: bar: 280, baz: 560, foo: 28\nDEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 310, baz: 620, foo: 31\nDEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 340, baz: 680, foo: 34\nDEBUG:procstat:EPS: bar: 10.0, foo: 1.0 | TOTAL: bar: 370, baz: 740, foo: 37\n...\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2021-2023, Gregory Petukhov  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Tool to count runtime metrics",
    "version": "0.0.8",
    "project_urls": {
        "homepage": "http://github.com/lorien/procstat"
    },
    "split_keywords": [
        "stat",
        "stats",
        "statistics",
        "metrics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c17f98b2a67926c5eabc43f7669c642844109c90d652572f1a8b80b306c6959",
                "md5": "609c4d24ac581dbfc50415f4d7ae356b",
                "sha256": "8c6a5a591b73e646da71cf72463686137cb46df50abfcc7413acceab5a2b9445"
            },
            "downloads": -1,
            "filename": "procstat-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "609c4d24ac581dbfc50415f4d7ae356b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8735,
            "upload_time": "2023-08-11T07:24:35",
            "upload_time_iso_8601": "2023-08-11T07:24:35.655485Z",
            "url": "https://files.pythonhosted.org/packages/2c/17/f98b2a67926c5eabc43f7669c642844109c90d652572f1a8b80b306c6959/procstat-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-11 07:24:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lorien",
    "github_project": "procstat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "procstat"
}
        
Elapsed time: 0.10425s