{ "info": { "author": "Daniel Gonzalez Lopes", "author_email": "danielgonzalezlopes@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: System :: Networking" ], "description": "# tcp-latency\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tcp-latency.svg)](https://pypi.org/project/tcp-latency/)\n[![PyPI](https://img.shields.io/pypi/v/tcp-latency.svg)](https://pypi.org/project/tcp-latency/)\n[![PyPI - License](https://img.shields.io/pypi/l/tcp-latency.svg)](https://github.com/dgzlopes/tcp-latency/blob/master/LICENSE.md)\n[![Build Status](https://travis-ci.org/dgzlopes/tcp-latency.svg?branch=master)](https://travis-ci.org/dgzlopes/tcp-latency)\n## About\n`tcp-latency` provides an easy way to measure latency using TCP.\n\nInspired by other [similar tools](#similar-tools), `tcp-latency` comes from the need of running network diagnosis/troubleshooting tasks with Python on serverless infrastructure (as many providers don't include ping/ICMP support) but should work too in any other environment with Python>=36.\n## Features\n- Runs as a command-line tool or inside your code as a module.\n- Custom parameters for a port, runs, timeout and wait time between runs.\n- IPv4 (e.g 52.26.14.11) and domain (e.g google.com) host support.\n- Human readable output when running as a command-line tool.\n- Small and extensible.\n## Usage\n`tcp-latency` can be used both as a module and as a standalone script.\n\n### Module\n```\n>>> from tcp_latency import measure_latency\n>>> measure_latency(host='google.com')\n[34.57]\n>>> measure_latency(host='52.26.14.11', port=80, runs=10, timeout=2.5)\n[433.82, 409.21, 409.25, 307.09, 306.64, 409.45, 306.58, 306.93, 409.25, 409.26]\n```\nNote: If omitted, `measure_latency()` arguments use the same defaults that command-line mode.\n### Command-line\n```\n$ tcplatency -h\nusage: tcp-latency [-h] [-p [p]] [-t [t]] [-r [r]] [-w [w]] h\n\nMeasure latency using TCP.\n\npositional arguments:\n host\n\noptional arguments:\n -h, --help show this help message and exit\n -p [p], --port [p] (default: 443)\n -t [t], --timeout [t]\n (seconds, float, default: 5)\n -r [r], --runs [r] number of latency points (int, default: 5)\n -w [w], --wait [w] between each run (seconds, float, default: 0)\n```\n```\n$ tcplatency google.com\ntcp-latency google.com\ngoogle.com: tcp seq=0 port=443 timeout=5 time=32.91 ms\ngoogle.com: tcp seq=1 port=443 timeout=5 time=14.1 ms\ngoogle.com: tcp seq=2 port=443 timeout=5 time=16.26 ms\ngoogle.com: tcp seq=3 port=443 timeout=5 time=16.35 ms\ngoogle.com: tcp seq=4 port=443 timeout=5 time=15.63 ms\n--- google.com tcp-latency statistics ---\n5 packets transmitted\n\n$ tcplatency 52.26.14.11 --port 80 --runs 3 --wait 0.5\ntcp-latency 52.26.14.11\n52.26.14.11: tcp seq=0 port=80 timeout=5 time=269.45 ms\n52.26.14.11: tcp seq=1 port=80 timeout=5 time=409.2 ms\n52.26.14.11: tcp seq=2 port=80 timeout=5 time=409.14 ms\n--- 52.26.14.11 tcp-latency statistics ---\n3 packets transmitted\n\n$ tcp-latency google.com -r 1\ntcp-latency google.com\ngoogle.com: tcp seq=0 port=443 timeout=5 time=34.36 ms\n--- google.com tcp-latency statistics ---\n1 packets transmitted\n```\n\n## Installation\nVia pip:\n```\npip install tcp-latency\n```\n## How to contribute\n1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.\n2. Fork [the repository](https://github.com/dgzlopes/tcp-latency) on GitHub to start making your changes to the master branch (or branch off of it).\n3. Write a test which shows that the bug was fixed or that the feature works as expected.\n4. Send a [pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) and bug [me](https://github.com/dgzlopes) until it gets merged and published.\n\nSome things that would be great to have:\n- Add at the end of human_output statistics (ping-like).\n- Add documentation (Sphinx?).\n- Add Ipv6 support.\n- Add support for machine-readable output (JSON?XML?).\n- Add automated releases with TravisCI.\n- Add codecov.\n- Improve formatting in human_output to feel more like ping.\n- Improve test suite.\n- Improve `How to contribute` information (pyenv, tox, pre-commit...)\n\n## Similar tools\n- [yantisj/tcpping](https://github.com/yantisj/tcpping)\n- [ipv6freely/tcpping](https://github.com/ipv6freely/tcpping)\n- [yahoo/serviceping](https://github.com/yantisj/tcpping)\n\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/dgzlopes/tcp-latency", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tcp-latency", "package_url": "https://pypi.org/project/tcp-latency/", "platform": "", "project_url": "https://pypi.org/project/tcp-latency/", "project_urls": { "Homepage": "https://github.com/dgzlopes/tcp-latency" }, "release_url": "https://pypi.org/project/tcp-latency/0.0.8/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Measure latency using TCP.", "version": "0.0.8" }, "last_serial": 5698478, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "65acf97e633090ad2e9cebfbe5a780d2", "sha256": "6188483dbd25e7039961f1ef9e357aaccfca7a1c115b5c67dd0b30281c9d044b" }, "downloads": -1, "filename": "tcp_latency-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "65acf97e633090ad2e9cebfbe5a780d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5338, "upload_time": "2019-07-18T10:11:30", "url": "https://files.pythonhosted.org/packages/d4/8a/f2f3cef98e03bd01206a818e82d47de01d7144faed93a74d91c59cbf7faa/tcp_latency-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ac3a8a02b1fc9bd28583806f2d58f50", "sha256": "d8a79beb274a9a2f33ad6a41489645b9c7b71bb24557b6fe9fe523165995f82d" }, "downloads": -1, "filename": "tcp-latency-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1ac3a8a02b1fc9bd28583806f2d58f50", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4106, "upload_time": "2019-07-18T10:11:32", "url": "https://files.pythonhosted.org/packages/71/c7/929e417ff0e7700f180df7ebf51c5194c280550ab9b3d31f936fbcd707b0/tcp-latency-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c3bf5632c4cc4de31fe497873e31951a", "sha256": "eafcac706cce1b8b677cc4feaf08d7c838eaacda39971e7f63bce665f39939a7" }, "downloads": -1, "filename": "tcp_latency-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c3bf5632c4cc4de31fe497873e31951a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5331, "upload_time": "2019-07-18T10:22:59", "url": "https://files.pythonhosted.org/packages/6c/fc/d23faa1024973eb1ab7cc6a41b3766ad4107fa735f1694709108161b26bc/tcp_latency-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45670a0d503769fd943acef06503e8bf", "sha256": "0e52cdec4cf26d7a5da922f5d1445691919dae508d7a8429caaa057a26a86c96" }, "downloads": -1, "filename": "tcp-latency-0.0.4.tar.gz", "has_sig": false, "md5_digest": "45670a0d503769fd943acef06503e8bf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4083, "upload_time": "2019-07-18T10:23:00", "url": "https://files.pythonhosted.org/packages/7a/b7/c10e73b362cd1bacdb4e6874393340bfa6563224ca8e8465a6589aece832/tcp-latency-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "4e355186bed71f7801c26c45a55041ad", "sha256": "78c70c08e942d3064879d81048e8ccb4023f628267fd0943065d56d690dbbcc5" }, "downloads": -1, "filename": "tcp_latency-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4e355186bed71f7801c26c45a55041ad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5394, "upload_time": "2019-07-19T05:39:28", "url": "https://files.pythonhosted.org/packages/88/76/733c864b1ca59bfa88431f5cd24f9c8dfd65b307cc2218f873da08c51e41/tcp_latency-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8af59f7d3cde15b8ed71c9917e32b86", "sha256": "4c3a8224bcbd6d701b0f3a2ec0add5109c9117343b27e4eb1f6b0ddb76840c6e" }, "downloads": -1, "filename": "tcp-latency-0.0.5.tar.gz", "has_sig": false, "md5_digest": "e8af59f7d3cde15b8ed71c9917e32b86", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4169, "upload_time": "2019-07-19T05:39:29", "url": "https://files.pythonhosted.org/packages/fe/18/d8b0bb8f7e430a1c40d5d34bbfbe35073d6c58e75f2aed228b302c9cede9/tcp-latency-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "e5e0a202215d504853c9469c613786f2", "sha256": "305c9b7f970ddbb287f85541b3da1e706e39da749be695ab495db80e776ce852" }, "downloads": -1, "filename": "tcp_latency-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "e5e0a202215d504853c9469c613786f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5397, "upload_time": "2019-07-19T05:43:32", "url": "https://files.pythonhosted.org/packages/a4/8c/40d05a0c16e849538838bf27b92d52b7adf7f1fb88062e92ff2b60c3b4d6/tcp_latency-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bab3e2dfc6d2e331c4d2f1ce29886639", "sha256": "8cd9ea49247b12dc9910ed8ae428c2e15651fd0aa5d299a43562f7250c7a54c0" }, "downloads": -1, "filename": "tcp-latency-0.0.6.tar.gz", "has_sig": false, "md5_digest": "bab3e2dfc6d2e331c4d2f1ce29886639", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4165, "upload_time": "2019-07-19T05:43:33", "url": "https://files.pythonhosted.org/packages/8f/e5/2f4e94ad214730344b8b566fc10cc19fbccf61d8352d3802975c954beaf6/tcp-latency-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "b5d1d3ffffef2be6fe3d2f02c0faf570", "sha256": "c21caf1c2ec8f7ccff9226bca4f702280b25ca1899a706f5bcf7902582a8797d" }, "downloads": -1, "filename": "tcp_latency-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "b5d1d3ffffef2be6fe3d2f02c0faf570", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5392, "upload_time": "2019-07-19T05:56:54", "url": "https://files.pythonhosted.org/packages/02/3c/db793c08da47fa7fdaa07eae4acb3dfcb7d093f63ce9d9077c1ae7ee9013/tcp_latency-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ac9683cde3fc317695a70b54e74a8c1", "sha256": "2fa6fb26591c7274cc3f3939bf7c1ecfd43dc048af0f950f42d4d5ac7c28e3aa" }, "downloads": -1, "filename": "tcp-latency-0.0.7.tar.gz", "has_sig": false, "md5_digest": "6ac9683cde3fc317695a70b54e74a8c1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4164, "upload_time": "2019-07-19T05:56:55", "url": "https://files.pythonhosted.org/packages/80/5c/f56bc5c1efbcf18c3c3c2aeff8199a0c31d08c30dd2906fa8cbd51c7f443/tcp-latency-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "f45e606fd5955ac5152c404aef3a6b13", "sha256": "716b9d986d021e598a55b27020b6eb3a80bdd3e80358484f2c6c4bf1899b9f42" }, "downloads": -1, "filename": "tcp_latency-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "f45e606fd5955ac5152c404aef3a6b13", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5557, "upload_time": "2019-08-19T13:52:10", "url": "https://files.pythonhosted.org/packages/a8/31/03c3ed942efbf7b00ccd5012be6391538c1335ef4765663897b5ca9d9e19/tcp_latency-0.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5ff0d8c2c0b417cc94ea30f9b5a1028", "sha256": "64455a331e8b0c8b74ac369754a11cba348b3236a4c9547ab191257d60742d60" }, "downloads": -1, "filename": "tcp-latency-0.0.8.tar.gz", "has_sig": false, "md5_digest": "f5ff0d8c2c0b417cc94ea30f9b5a1028", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4397, "upload_time": "2019-08-19T13:52:11", "url": "https://files.pythonhosted.org/packages/90/8c/65db7a78c5404fef7e2bc9deb940a215de71eca12697965652915ea6609b/tcp-latency-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f45e606fd5955ac5152c404aef3a6b13", "sha256": "716b9d986d021e598a55b27020b6eb3a80bdd3e80358484f2c6c4bf1899b9f42" }, "downloads": -1, "filename": "tcp_latency-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "f45e606fd5955ac5152c404aef3a6b13", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5557, "upload_time": "2019-08-19T13:52:10", "url": "https://files.pythonhosted.org/packages/a8/31/03c3ed942efbf7b00ccd5012be6391538c1335ef4765663897b5ca9d9e19/tcp_latency-0.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5ff0d8c2c0b417cc94ea30f9b5a1028", "sha256": "64455a331e8b0c8b74ac369754a11cba348b3236a4c9547ab191257d60742d60" }, "downloads": -1, "filename": "tcp-latency-0.0.8.tar.gz", "has_sig": false, "md5_digest": "f5ff0d8c2c0b417cc94ea30f9b5a1028", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4397, "upload_time": "2019-08-19T13:52:11", "url": "https://files.pythonhosted.org/packages/90/8c/65db7a78c5404fef7e2bc9deb940a215de71eca12697965652915ea6609b/tcp-latency-0.0.8.tar.gz" } ] }