// Package probe measures per-phase HTTP request latency.
package probe

import "time"

// Phase holds the measured duration of a single request phase.
// A zero Duration means the phase did not occur (e.g. TLS on plain HTTP).
type Phase struct {
	Duration time.Duration
	// Present is false when the phase was skipped (e.g. no TLS for http://).
	Present bool
}

// Result holds all timing phases for a single HTTP request.
type Result struct {
	URL      string
	DNS      Phase
	Connect  Phase
	TLS      Phase
	TTFB     Phase // server processing: WroteRequest → GotFirstResponseByte
	Transfer Phase // body read: GotFirstResponseByte → body closed
	Total    Phase

	// StatusCode is the HTTP response status code (0 on error).
	StatusCode int
	// Err is non-nil if the request failed.
	Err error
}

// Measure performs an HTTP GET request to url and returns a populated Result.
// It is a placeholder until Step 1 wires in the actual implementation.
func Measure(url string) Result {
	return Result{URL: url}
}
