Files
Pim van Pelt 5a7e2f77f1 Add ngx_http_ipng_stats_module: per-VIP, per-device traffic counters
Full implementation of the nginx dynamic module with:
- SO_BINDTODEVICE-based per-interface traffic attribution
- Per-worker lock-free counters flushed to shared memory
- Prometheus text and JSON scrape endpoint at configurable location
- UDP-only global logtail (ipng_stats_logtail) for fire-and-forget
  access log streaming
- $ipng_source_tag nginx variable for use in log_format/map
- Histogram buckets, EWMA rate gauges, zone meta-metrics
- Debian packaging (libnginx-mod-http-ipng-stats)
- Robot Framework end-to-end tests via containerlab
- SPDX Apache-2.0 headers on all source files
2026-04-16 17:41:23 +02:00

23 lines
645 B
Python

#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Minimal HTTP server that sleeps 50 ms before responding.
# Used by the test harness to produce measurable request durations.
import http.server
import socketserver
import time
class SlowHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
time.sleep(0.05)
self.send_response(200)
self.send_header("Content-Type", "text/plain")
self.end_headers()
self.wfile.write(b"slow\n")
def log_message(self, format, *args):
pass
with socketserver.TCPServer(("127.0.0.1", 29080), SlowHandler) as srv:
srv.serve_forever()