How googlecloudplatform/gcping works
GCPing is a latency-measurement product with a CLI, web application, browser extension, and regional HTTP services. Users obtain a region endpoint list, request regional pings, and compare latency results; the CLI also supports single-region, fastest-region, and CSV reports. The source shows the CLI, web, extension, and service-handler behavior. The README documents self-hosting through Terraform, but the deployment implementation was not sampled, so that relationship is marked unverified.
Main entry points: httphandler.go API and static handlers · main.go CLI options · worker.go Ping workers · gcping.js Web ping and results
Components 13
Measurement clients
- CLI options
main.go - Ping workers
worker.go - CLI reports
worker.go - Web ping and results
web/src/js/gcping.js - Extension ping
ext/js/service-worker.js
Regional service
- HTTP server
cmd/ping/main.go - API and static handlers
internal/httphandler/httphandler.go
Endpoint configuration
- Region endpoints
internal/config/endpoints.go
Self-hosting
- Cloud Run deployment
tools/terraform
Other components
- User
- Extension user
- Regional ping services
- Web assets
web/src/index.html
Connections 16
- User → CLI options: runs
README.md - CLI options → Region endpoints: fetches list
main.go - CLI options → Ping workers: dispatches reports
main.go - Ping workers → Regional ping services: requests pings
worker.go - Ping workers → CLI reports: collects timings
worker.go - User → Web ping and results: opens app
README.md - Web ping and results → API and static handlers: fetches endpoints
web/src/js/gcping.js - Web ping and results → Regional ping services: measures latency
web/src/js/gcping.js - Extension user → Extension ping: clicks action
ext/js/service-worker.js - Extension ping → Regional ping services: requests pings
ext/js/service-worker.js - Extension ping → Region endpoints: fetches list
ext/js/service-worker.js - HTTP server → API and static handlers: serves requests
cmd/ping/main.go - HTTP server → Region endpoints: provides endpoints
cmd/ping/main.go - API and static handlers → Web assets: serves files
internal/httphandler/httphandler.go - API and static handlers → Regional ping services: returns region
internal/httphandler/httphandler.go - Cloud Run deployment → HTTP server: deploys services
README.md