{"id":18805578,"url":"https://github.com/melchor629/speedy","last_synced_at":"2026-04-29T21:03:57.768Z","repository":{"id":65662011,"uuid":"141894266","full_name":"melchor629/speedy","owner":"melchor629","description":"Utility for gateways/routers to collect network speed stats from everyone","archived":false,"fork":false,"pushed_at":"2019-07-21T16:53:47.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T22:38:37.129Z","etag":null,"topics":["docker","docker-image","go","golang","linux","network-visualization","time-series"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melchor629.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-22T12:36:04.000Z","updated_at":"2019-07-21T16:53:49.000Z","dependencies_parsed_at":"2023-02-03T00:55:12.475Z","dependency_job_id":null,"html_url":"https://github.com/melchor629/speedy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/melchor629/speedy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchor629%2Fspeedy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchor629%2Fspeedy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchor629%2Fspeedy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchor629%2Fspeedy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melchor629","download_url":"https://codeload.github.com/melchor629/speedy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchor629%2Fspeedy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","go","golang","linux","network-visualization","time-series"],"created_at":"2024-11-07T22:44:25.113Z","updated_at":"2026-04-29T21:03:57.752Z","avatar_url":"https://github.com/melchor629.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# speedy\n\n \u003e Utility for gateways/routers to collect network speed stats from everyone\n\nThe utility for Linux that captures the traffic over a network interface and stores the network usage of every device in a time-series DB. It is written in Go and uses `libpcap` to grab the packets.\n\nThe data is stored using the MAC address of every client as a key (of some sort) and storing the download and upload quantity in a second. Also stores the MAC again, the last IPv4 and IPv6 used (if available). Downsampling and cleaning is up to the database implementation or up to you (or both). It is recommended to create the structure firsrt before starting to run the utility.\n\n## Usage\n\nHaving defined a `GOROOT` for a terminal session, you can simply do:\n\n```bash\ngo get -d -v github.com/influxdata/influxdb/client/v2\ngo get -d -v github.com/google/gopacket\ngo get -d -v github.com/lib/pq\ngo get -d -v github.com/melchor629/speedy\ngo run src/github.com/melchor629/speedy/main.go #args...\n```\n\nYou can always build the executable (cross-compiling is not available or at least not easily):\n\n```bash\ncd src/github.com/melchor629/speedy\ngo install -v ./...\n$GOROOT/bin/speedy #args...\n```\n\nThe utility needs a time-series database on which the data will be stored. Currently, [influxdb][1] and [timescaledb][3] are the only supported, but more it will be added.\n\nThe arguments can be seen with `speedy -help`. The available database implementations can be seen with `speedy -help db`. The available network interfaces can be seen with `speedy -help device`.\n\n## Usage with Docker\n\n```bash\ndocker container run --rm -it --cap-add NET_RAW --cap-add NET_ADMIN --network host melchor9000/speedy:alpine speedy #args...\n```\n\nIt is needed to use the host network mode to allow the container to list all the network interfaces, and these two Linux capabilities to have the right permissions to capture the interfaces.\n\n## Build the images\n\nBeing in the root of the repository, these commands will build the three tags available for this repo:\n\n```bash\ndocker image build -t melchor9000/speedy:latest -f docker/latest/Dockerfile .\ndocker image build -t melchor9000/speedy:slim -f docker/slim/Dockerfile .\ndocker image build -t melchor9000/speedy:alpine -f docker/alpine/Dockerfile .\ndocker image build -t melchor9000/speedy:test -f docker/Dockerfile . #Test version, grabs the code from your PC :)\n```\n\n## Example with influxdb, chronograf and docker-compose\n\nYou can see [docker/compose/influxdb.yaml][2] for an example. To run the example, simply execute from the root of the repo:\n\n```bash\nDEVICE=YOUR_NIC_NAME docker-compose -f docker/compose/influxdb.yaml up\n```\n\nThe example sets a database that everyday will downsample the data into `\"monthly_gc\".\"downsampled\"` (where `\"monthly_gc\"` is a _retention policy_ and `\"downsampled\"` is a measurement). Then, will store the downsampled versions for \"a month\" (aka 4 weeks). A chronograf will be avaiable in http://localhost:8888 for you to play with the data an visualize it.\n\n## Database implementations\n\n### influxdb\n\nThe implementation stores a measure in `measures` with the data. Is it up to you to make retention policies and continues queries, as the way you want. Inside `docker/compose/iql` there's an example of a database.\n\nThis implementation stores extra information (like the IP) in `measures_metadata`.\n\n### timescaledb / postgresql\n\nThe implementation stores the data into the table passed by `-db-name` option. The `-db-url` has the following format `postgres://USER:PASSWORD@ADDRESS/DATABASE[?...extraOptions]`. See [pq][4] documentation for the full specification of the URL format. The schema and the table must be created by you, but I will let you an example down:\n\n```sql\nCREATE TABLE speedy (\n  time        TIMESTAMPTZ       NOT NULL, /* This one must always be there, with that name */\n  mac         MACADDR           NOT NULL,\n  download    BIGINT            NOT NULL,\n  upload      BIGINT            NOT NULL\n);\n\nCREATE TABLE speedy_metadata (\n  mac         MACADDR           PRIMARY KEY,\n  ipv4        INET              NULL,\n  ipv6        INET              NULL\n);\n\nSELECT create_hypertable('speedy', 'time');\n\nCREATE INDEX ON speedy (mac, time DESC);\n```\n\n \u003e **Note**: If you don't use SSL for postgreSQL (as expected in most of the time), add `sslmode=disable` option in the URL to tell the go postgreSQL driver to not to use SSL.\n\n\nThe implementation will split the metadata (with the IPs) into a separate table. It will hold the last known data of that extra information.\n\n\n  [1]: https://influxdata.com\n  [2]: https://github.com/melchor629/speedy/blob/master/docker/compose/influxdb.yaml\n  [3]: https://timescaledb.com\n  [4]: https://godoc.org/github.com/lib/pq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchor629%2Fspeedy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelchor629%2Fspeedy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchor629%2Fspeedy/lists"}