{ "info": { "author": "Abdulelah Bin Mahfoodh", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Monitoring", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "\n# pdsys\n\nPandas-like Python package for systems monitoring\n\n### Basic usage\n\n```python\nimport pdsys\n```\n\nTo get a system utilization report (as dataframe) on local:\n\n```python\ndf = pdsys.report()\n```\n\npdsys returns by default all process attributes information from ***psutil*** process iterator:\n\n```python\ndf.columns.tolist()\n>>> ['cmdline',\n 'connections',\n 'cpu_affinity',\n 'cpu_num',\n 'cpu_percent',\n 'cpu_times.children_system',\n 'cpu_times.children_user',\n 'cpu_times.system',\n 'cpu_times.user',\n 'create_time',\n 'cwd',\n 'environ',\n 'exe',\n 'gids.effective',\n 'gids.real',\n 'gids.saved',\n 'hostname',\n 'io_counters',\n 'io_counters.read_bytes',\n 'io_counters.read_chars',\n 'io_counters.read_count',\n 'io_counters.write_bytes',\n 'io_counters.write_chars',\n 'io_counters.write_count',\n 'ionice.value',\n 'memory_full_info',\n 'memory_full_info.data',\n 'memory_full_info.dirty',\n 'memory_full_info.lib',\n 'memory_full_info.pss',\n 'memory_full_info.rss',\n 'memory_full_info.shared',\n 'memory_full_info.swap',\n 'memory_full_info.text',\n 'memory_full_info.uss',\n 'memory_full_info.vms',\n 'memory_info.data',\n 'memory_info.dirty',\n 'memory_info.lib',\n 'memory_info.rss',\n 'memory_info.shared',\n 'memory_info.text',\n 'memory_info.vms',\n 'memory_maps',\n 'memory_percent',\n 'name',\n 'nice',\n 'num_ctx_switches.involuntary',\n 'num_ctx_switches.voluntary',\n 'num_fds',\n 'num_threads',\n 'open_files',\n 'pid',\n 'ppid',\n 'status',\n 'terminal',\n 'threads',\n 'uids.effective',\n 'uids.real',\n 'uids.saved',\n 'username']\n```\n\nYou can query the output dataframe to get more insights about the system:\n```python\n# getting top 5 processes sorted by memory utilization \ndf.sort_values(by='memory_percent', \n ascending=False)[['name', 'memory_percent']].head(5)\n```\n\n| | name | memory_percent |\n|----:|:-----------------|-----------------:|\n| 104 | systemd-journald | 20.865 |\n| 76 | gunicorn | 4.06886 |\n| 75 | gunicorn | 4.05697 |\n| 77 | gunicorn | 4.01536 |\n| 74 | gunicorn | 1.92189 |\n\n\nAlso, pdsys can run reports from remote systems by providing list of hosts:\n```python\ndf = pdsys.report(hosts=['user@host1', 'user@host2'])\ndf[df.memory_percent > 0.9].groupby(['hostname',\n 'name']).agg({'memory_percent': 'sum',\n 'pid': 'count',\n 'num_threads': 'sum',\n 'memory_info.rss': lambda x: sum(x) / 1e6})\n```\n| | hostname | name | memory_percent | pid | num_threads | memory_info.rss |\n|---:|:-----------|:--------------------------------|-----------------:|------:|--------------:|------------------:|\n| 0 | host1 | Google Chrome | 2.13456 | 1 | 31 | 183.357 |\n| 1 | host1 | Google Chrome Helper (GPU) | 1.31197 | 1 | 9 | 112.697 |\n| 2 | host1 | Google Chrome Helper (Renderer) | 9.3699 | 8 | 107 | 804.868 |\n| 3 | host1 | Python | 1.0848 | 1 | 12 | 93.184 |\n| 4 | host1 | Terminal | 1.7745 | 1 | 6 | 152.429 |\n| 5 | host1 | pycharm | 9.88402 | 1 | 66 | 849.031 |\n| 6 | host2 | do-agent | 1.19791 | 1 | 6 | 12.3822 |\n| 7 | host2 | gunicorn | 14.0631 | 4 | 4 | 145.363 |\n| 8 | host2 | postgres | 1.54504 | 1 | 1 | 15.9703 |\n| 9 | host2 | python3 | 3.47208 | 3 | 4 | 35.8892 |\n| 10 | host2 | systemd-journald | 21.0484 | 1 | 1 | 217.567 |\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/abduhbm/pdsys", "keywords": "system monitoring pandas metrics performance", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pdsys", "package_url": "https://pypi.org/project/pdsys/", "platform": "", "project_url": "https://pypi.org/project/pdsys/", "project_urls": { "Homepage": "https://github.com/abduhbm/pdsys" }, "release_url": "https://pypi.org/project/pdsys/0.1/", "requires_dist": [ "psutil", "pandas" ], "requires_python": "", "summary": "Pandas-like Python package for systems monitoring", "version": "0.1" }, "last_serial": 5997946, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8a4d68aad69241a4d08d0421352f634e", "sha256": "53c36632bdff2cf7e73a43dbb2258ce46b91e29942f34d13366266d13e0598f8" }, "downloads": -1, "filename": "pdsys-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a4d68aad69241a4d08d0421352f634e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4372, "upload_time": "2019-10-18T22:53:26", "url": "https://files.pythonhosted.org/packages/8c/37/84c0e721f80f0cdf6b7a29dd52dc01c9bf61135645c587aa1c8cc6465528/pdsys-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d3799af721703a225c66accf19f214c", "sha256": "5d61cdaedf84eacf8e1b7740bb5253ffdebdf0cdae5e29d644ab2d5117affe73" }, "downloads": -1, "filename": "pdsys-0.1.tar.gz", "has_sig": false, "md5_digest": "9d3799af721703a225c66accf19f214c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4510, "upload_time": "2019-10-18T22:53:29", "url": "https://files.pythonhosted.org/packages/b9/b7/991907377ddb65f701c60d14f616ee24153c6a62a6d12b62b87f431f0e56/pdsys-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a4d68aad69241a4d08d0421352f634e", "sha256": "53c36632bdff2cf7e73a43dbb2258ce46b91e29942f34d13366266d13e0598f8" }, "downloads": -1, "filename": "pdsys-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a4d68aad69241a4d08d0421352f634e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4372, "upload_time": "2019-10-18T22:53:26", "url": "https://files.pythonhosted.org/packages/8c/37/84c0e721f80f0cdf6b7a29dd52dc01c9bf61135645c587aa1c8cc6465528/pdsys-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d3799af721703a225c66accf19f214c", "sha256": "5d61cdaedf84eacf8e1b7740bb5253ffdebdf0cdae5e29d644ab2d5117affe73" }, "downloads": -1, "filename": "pdsys-0.1.tar.gz", "has_sig": false, "md5_digest": "9d3799af721703a225c66accf19f214c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4510, "upload_time": "2019-10-18T22:53:29", "url": "https://files.pythonhosted.org/packages/b9/b7/991907377ddb65f701c60d14f616ee24153c6a62a6d12b62b87f431f0e56/pdsys-0.1.tar.gz" } ] }