• Stars
    star
    188
  • Rank 204,396 (Top 5 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

darkcoding-credit-card

Credit card generators from darkcoding.net
C#
224
star
2

perf-ninja-rs

Rust port of dendibakh/perf-ninja - an online course where you can learn and master the skill of low-level performance analysis and tuning.
Rust
185
star
3

Key-Value-Polyglot

A basic key-value store, repeated in C, Go, Python (basic, gevent, and diesel), Ruby (event machine), Java, Scala, Haskell, and NodeJS.
C
159
star
4

hatcog

The IRC client for tmux addicts
Python
65
star
5

lintswitch

Automatically runs pylint, pep8 and pymetrics on your code, and notifies you of the results.
Python
26
star
6

kip

Command line script to keep usernames/passwords in gnupg encrypted text files.
Python
23
star
7

demeter-deploy

Fast remote push. Deploy your Hugo blog.
Rust
16
star
8

croxy

Encrypting IRC proxy
Python
15
star
9

netshare

A fast single-file web server. epoll + sendfile.
C
7
star
10

kipr

Password manager. Command line script to keep usernames/passwords in gnupg encrypted text files.
Rust
7
star
11

echoip

Go UDP / TCP server replies your IP address and location
Go
5
star
12

loftus

Loftus: Personal backup and sync. DropBox /SpiderOak style. inotify and git, driven from a Go daemon.
Go
4
star
13

tip

Command line timer
Python
4
star
14

jeb

Mailgun did it, so use that: https://github.com/mailgun/godebug
Go
2
star
15

logfmtcpp

logfmt parser in C++.
C++
2
star
16

rweather

Display local weather, fetched from weather.noaa.gov. Mostly I'm learning Rust.
Rust
2
star
17

django-timing-test-runner

A test runner for django-jenkins that prints your 10 slowest tests
Python
2
star
18

goodenergy

Web app for behavior change and online engagement. Built with Django. See demo at http://live.goodenergy.ca
Python
2
star
19

isqueue

isqueue is a unix queue. inotify spooled queue.
Shell
2
star
20

ccserve

C++ credit card server.
C++
2
star
21

hashgk

A just-for-fun hashtable in C.
C
1
star
22

scriptable

Make a python function callable from the command line and usable in pipes.
Python
1
star
23

binmsg

Write data into ELF binary files. Excuse to write some assembly.
Assembly
1
star
24

plebis.net

Source code to plebis.net.
Go
1
star
25

oilcan

Python job manager for Gearman
Python
1
star
26

areatalk

Android app to chat with people on the same router as you.
Java
1
star
27

route

Basic URL routing for Go web apps
Go
1
star
28

carriagereturn

Source code to carriagereturn.org
Go
1
star