Commit Graph

9 Commits

Author SHA1 Message Date
45583ac2be docs: add 10 custom usage examples covering all failure modes
Examples 1-3: clean global sweep (single, 10 samples, JSON).
Examples 4-8: one failure type each (DNS, refused, timeout, HTTP, TLS).
Example 9: full matrix, all 5 failure types in one run.
Example 10: quick smoke test (-n 1, JSON, --timeout 2s, all types).
Includes runtime estimates and jq filter snippets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 01:16:39 +02:00
0cf5b54070 chore: add root Makefile with namespaced targets
Namespaced go-* targets (build, run, test, test-verbose, check, cover,
fmt, vet, tidy, install, lint, clean) plus umbrella targets that delegate
to them. help is the default. py-* targets will slot in during the Python
port. Updates .gitignore with coverage artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 01:08:51 +02:00
a9534ec2c1 test(go): step 6 — integration tests covering all exit codes and output
Extract run(args, stdout, stderr) int from main() for in-process
testability. Fix TLS failure classification (tlsErr now captured from
TLSHandshakeDone hook). Add run_test.go with 14 table-driven in-process
tests and cli_test.go with TestMain + 3 subprocess smoke tests. All
servers use httptest; .invalid TLD for deterministic DNS failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 01:00:20 +02:00
c323d879d0 feat(go): step 5 — failure handling with classified exit codes
Classify network failures (dns/connect/timeout/tls) with distinct exit
codes 2-5. Add --timeout (default 10s) via context.WithTimeout. Add
--fail for exit 6 on HTTP status >= 400. Preserve partial phase timing
up to the failure point. -n sampling continues on network failures,
aggregating successes and reporting fail counts. JSON extended with
succeeded/failed/errors fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:45:56 +02:00
3affc05996 feat(go): step 4 — --json output flag
Add --json flag that emits all results as a JSON array. Schema always
uses min/avg/max per phase (consistent regardless of -n); phases absent
from the request are omitted from the phases object. Output is buffered
until all URLs complete, then printed as one pretty-printed array.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:31:54 +02:00
8ec926bbcd feat(go): step 3 — multiple URLs and -n sampling with min/avg/max
Add probe.Summarize to aggregate N Results into per-phase min/avg/max
stats. Wire up -n/--count flag in main to repeat each URL N times and
display an aligned three-column table. Single-sample output (n=1) is
unchanged. URLs are grouped with a blank line between them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:29:36 +02:00
0ecfb9bb1a feat(go): step 2 — per-phase request breakdown via httptrace
Instruments HTTP requests with net/http/httptrace.ClientTrace to capture
timestamps for DNS, TCP connect, TLS handshake, TTFB, and body transfer.
TLS row is omitted automatically for plain http:// URLs. Output is an
aligned text table with a separator before the Total row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:23:36 +02:00
a588eb3b0e feat(go): step 1 — total wall-clock latency per URL
probe.Measure performs an HTTP GET and records total elapsed time from
request start to body fully read. main.go prints URL, status code, and
total for each positional URL argument, exiting 1 on any failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:21:12 +02:00
5717f018b7 chore: initial scaffold for latprobe CLI tool
Sets up project structure, working conventions (CLAUDE.md), README with
the full assignment and roadmap, seeded CHANGELOG, and a buildable Go
scaffold (Step 0) with flag parsing and stub probe types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 00:16:05 +02:00