Go to file
sneak 8be7002ad9 Fix latency measurement and chart direction
- Use Resource Timing API for accurate network latency instead of
  performance.now() around fetch (fixes ~600ms measurement error)
- Chart now shows latest sample at right edge, growing left
- Reduce request timeout from 5000ms to 1000ms
2026-01-30 22:23:35 -08:00
src Fix latency measurement and chart direction 2026-01-30 22:23:35 -08:00
.gitignore Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00
index.html Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00
package.json Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00
README.md Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00
vite.config.js Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00
yarn.lock Initial implementation of NetWatch network latency monitor 2026-01-29 21:32:19 -08:00

NetWatch

Real-time network latency monitor SPA designed to be served from a static bucket.

Features

  • Real-time monitoring: Updates every 250ms
  • 10 monitored hosts: Google Cloud, AWS, GitHub, Cloudflare, Azure, DigitalOcean, Fastly, Akamai, local gateway (192.168.100.1), and datavi.be
  • Visual latency display: Large color-coded latency figures (NNNms format)
  • Sparkline graphs: 300-second history visualization for each host
  • Color coding:
    • Green: <50ms (excellent)
    • Lime: <100ms (good)
    • Yellow: <200ms (moderate)
    • Orange: <500ms (poor)
    • Red: >500ms (bad)
    • Gray: offline/unreachable
  • Zero runtime dependencies: All resources bundled into build artifacts
  • IPv4 only: Designed for IPv4 connectivity testing

Technical Details

  • Latency measured via HEAD requests with cache-busting
  • Uses mode: 'no-cors' to allow cross-origin requests where CORS headers aren't present
  • 5-second timeout for unresponsive hosts
  • Canvas-based sparkline rendering
  • Tailwind CSS v4 for styling

Build

# Install dependencies
yarn install

# Development server
yarn dev

# Production build
yarn build

# Preview production build
yarn preview

Deployment

After running yarn build, deploy the contents of the dist/ directory to any static file host:

  • AWS S3
  • Google Cloud Storage
  • Cloudflare Pages
  • Vercel
  • Netlify
  • GitHub Pages

Output Structure

dist/
├── index.html
└── assets/
    ├── index-*.css
    └── index-*.js

All assets are bundled and minified. No external dependencies at runtime.

Browser Compatibility

Requires modern browser with:

  • ES modules support
  • Fetch API
  • Canvas API
  • CSS custom properties

Limitations

  • CORS: Some hosts may block cross-origin HEAD requests. The app uses no-cors mode which allows the request but provides opaque responses. Latency is still measurable based on request timing.
  • Local gateway: The 192.168.100.1 endpoint requires the host to be accessible from your network.
  • Network conditions: Measurements reflect browser-to-endpoint latency, which includes your local network, ISP, and internet routing.

License

MIT