This release is a pre-release and may not be stable for production use.
一个类似于 ping 的系统工具, 检测在连接 tcp 时候的延迟, 比较正确是反应出网络的延迟情况,毕竟 tcp 用途比较广。
虽然和 icmp 的 ping 原理不同,ping 命令也能很大程度上反映出网络的延迟, 但是该矫情还是要矫情一把的。
Usage
pip install tcping
➜ ~ tcping api.github.com Connected to api.github.com[:80]: seq=1 time=236.44 ms Connected to api.github.com[:80]: seq=2 time=237.99 ms Connected to api.github.com[:80]: seq=3 time=248.88 ms Connected to api.github.com[:80]: seq=4 time=233.51 ms Connected to api.github.com[:80]: seq=5 time=249.23 ms Connected to api.github.com[:80]: seq=6 time=249.77 ms Connected to api.github.com[:80]: seq=7 time=235.82 ms Connected to api.github.com[:80]: seq=8 time=242.30 ms Connected to api.github.com[:80]: seq=9 time=248.26 ms Connected to api.github.com[:80]: seq=10 time=251.77 ms --- api.github.com[:80] tcping statistics --- 10 connections, 10 successed, 0 failed, 100.00% success rate minimum = 233.51ms, maximum = 251.77ms, average = 243.40ms
呵呵,GFW,66666
➜ ~ tcping --help Usage: tcping [OPTIONS] HOST Options: -p, --port INTEGER Tcp port -c, --count INTEGER Try connections counts -t, --timeout FLOAT Timeout seconds --report / --no-report Show report to replace statistics --help
其中这个 --report 可以生成一个 ascii 的 table,好看一点吧。。。
➜ ~ tcping api.github.com -c 3 --report Connected to api.github.com[:80]: seq=1 time=237.79 ms Connected to api.github.com[:80]: seq=2 time=237.72 ms Connected to api.github.com[:80]: seq=3 time=258.53 ms +----------------+------+-----------+--------+--------------+----------+----------+----------+ | Host | Port | Successed | Failed | Success Rate | Minimum | Maximum | Average | +----------------+------+-----------+--------+--------------+----------+----------+----------+ | api.github.com | 80 | 3 | 0 | 100.00% | 237.72ms | 258.53ms | 244.68ms | +----------------+------+-----------+--------+--------------+----------+----------+----------+
END
其实写这个主要是为了测试搭建翻墙 VPS 的 tcp 延迟。。。
Metadata
Release files for tcping 0.1.1rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tcping-0.1.1rc1.tar.gz | 4.1 kB | Without provenance | Details for tcping-0.1.1rc1.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tcping-0.1.1rc1-py2.7.egg | Legacy Egg format | - | - | Details for tcping-0.1.1rc1-py2.7.egg |
| tcping-0.1.1rc1-py2-none-any.whl | Python 2 | none | any | Details for tcping-0.1.1rc1-py2-none-any.whl |
Total release size: 21.8 kB
Release files / tcping-0.1.1rc1.tar.gz
| Download URL | tcping-0.1.1rc1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
557d5e928601e5a31e55abe20c6b9fff18bdc74a1e1d620d6b28b2f7c7a26606
|
|
BLAKE2b-256 checksum How to use checksums |
2aa17e8ac7d81a1a89b1cdb8200fee2c0779410a63743806213cb9289ab6ee94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tcping-0.1.1rc1-py2.7.egg
| Download URL | tcping-0.1.1rc1-py2.7.egg |
|---|---|
| Size | 9.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
10843d60e2c3abbdf1b4aed0d1133c25d7bc15310d61fd8a0dbd91236d646c29
|
|
BLAKE2b-256 checksum How to use checksums |
6cb2dff5772613436c3aaaf2d2b1f02387b9b9c7b43ae0831c12fbfe8eaeacc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tcping-0.1.1rc1-py2-none-any.whl
| Download URL | tcping-0.1.1rc1-py2-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
48ad03a463cf6d963454d45c199843dc0ad4fb0cd0dde6ab648e35364cbfe34a
|
|
BLAKE2b-256 checksum How to use checksums |
b3f8d90058c75b09e28260d9b6cb22c25507dea0733df288394fa10f2d8eb20c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tcping 0.1.1rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.