prober: include current probe results in run-probe text response

It was a bit confusing that provided history did not include the
current probe results.

Updates tailscale/corp#20583

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
Anton Tolchanov
2025-09-06 09:28:07 +01:00
committed by Anton Tolchanov
parent a29545e9cc
commit ed6aa50bd5
2 changed files with 10 additions and 8 deletions

View File

@@ -570,9 +570,9 @@ func (p *Prober) RunHandler(w http.ResponseWriter, r *http.Request) error {
return nil
}
stats := fmt.Sprintf("Last %d probes: success rate %d%%, median latency %v\n",
len(prevInfo.RecentResults),
int(prevInfo.RecentSuccessRatio()*100), prevInfo.RecentMedianLatency())
stats := fmt.Sprintf("Last %d probes (including this one): success rate %d%%, median latency %v\n",
len(info.RecentResults),
int(info.RecentSuccessRatio()*100), info.RecentMedianLatency())
if err != nil {
return tsweb.Error(respStatus, fmt.Sprintf("Probe failed: %s\n%s", err.Error(), stats), err)
}