latency

Measure network round-trip latency by sending a TCP SYN packet.

  • 所有者: grahamking/latency
  • 平台:
  • 许可证: GNU General Public License v3.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Install: go get github.com/grahamking/latency

Run: sudo latency [hostname].

Example output:

$ sudo ./latency github.com

Measuring round-trip latency from 192.168.1.26 to 192.30.252.131 on port 80

Latency: 116.601914ms

The sudo is needed to open a raw socket. If you know how to do this with capabilities, please do tell.

latency can also run in auto mode, where it tests a range of well known sites (which will be geo-balanced), and some servers in specific locations. It's fun, try it! sudo latency -a

latency sends a TCP SYN packet (the opening of the three-way handshake) to a remote host on port 80. That host will respond with either a RST (if the port is closed), or a SYN/ACK (if the port is open). Either way, we time how long it takes between sending the SYN and receiving the response. That's your network latency.

There are of course many other ways to measure this (mtr is nice), but this is a fun exercise in using raw sockets and binary encoding in Go.

License: GPL.

主要指标

概览
名称与所有者grahamking/latency
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证GNU General Public License v3.0
所有者活动
创建于2014-01-01 20:08:55
推送于2016-03-30 16:50:50
最后一次提交2016-03-30 09:50:49
发布数0
用户参与
星数191
关注者数2
派生数37
提交数15
已启用问题?
问题数2
打开的问题数2
拉请求数4
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?