diff options
| author | Anton Tolchanov <anton@tailscale.com> | 2024-08-08 09:38:17 +0100 |
|---|---|---|
| committer | Anton Tolchanov <1687799+knyar@users.noreply.github.com> | 2024-08-08 17:34:29 +0100 |
| commit | 46db69833399f558285dfb564c48bdafd9fa0b07 (patch) | |
| tree | 0bcd9e65b6efda18aaba803b337435a2b3f904f0 | |
| parent | f79183dac7d9ddf6517f5e6c99b8e62ab94890a4 (diff) | |
| download | tailscale-46db69833399f558285dfb564c48bdafd9fa0b07.tar.xz tailscale-46db69833399f558285dfb564c48bdafd9fa0b07.zip | |
prober: make status page more clear
Updates tailscale/corp#20583
Signed-off-by: Anton Tolchanov <anton@tailscale.com>
| -rw-r--r-- | prober/prober.go | 3 | ||||
| -rw-r--r-- | prober/status.go | 2 | ||||
| -rw-r--r-- | prober/status.html | 10 |
3 files changed, 8 insertions, 7 deletions
diff --git a/prober/prober.go b/prober/prober.go index 333661a38..2a43628bd 100644 --- a/prober/prober.go +++ b/prober/prober.go @@ -496,7 +496,8 @@ func (p *Prober) RunHandler(w http.ResponseWriter, r *http.Request) error { return nil } - stats := fmt.Sprintf("Previous runs: success rate %d%%, median latency %v", + stats := fmt.Sprintf("Last %d probes: success rate %d%%, median latency %v\n", + len(prevInfo.RecentResults), int(prevInfo.RecentSuccessRatio()*100), prevInfo.RecentMedianLatency()) if err != nil { return tsweb.Error(respStatus, fmt.Sprintf("Probe failed: %s\n%s", err.Error(), stats), err) diff --git a/prober/status.go b/prober/status.go index 034c5302d..aa9ef99d0 100644 --- a/prober/status.go +++ b/prober/status.go @@ -86,7 +86,7 @@ func (p *Prober) StatusHandler(opts ...statusHandlerOpt) tsweb.ReturnHandlerFunc } s := probeStatus{ProbeInfo: info} if !info.End.IsZero() { - s.TimeSinceLast = time.Since(info.End) + s.TimeSinceLast = time.Since(info.End).Truncate(time.Second) } for textTpl, urlTpl := range params.probeLinks { text, err := renderTemplate(textTpl, info) diff --git a/prober/status.html b/prober/status.html index eecce1463..ff0f06c13 100644 --- a/prober/status.html +++ b/prober/status.html @@ -71,12 +71,12 @@ <table class="sortable"> <thead><tr> <th>Name</th> - <th>Class & Labels</th> + <th>Probe Class & Labels</th> <th>Interval</th> - <th>Result</th> + <th>Last Attempt</th> <th>Success</th> <th>Latency</th> - <th>Error</th> + <th>Last Error</th> </tr></thead> <tbody> {{range $name, $probeInfo := .Probes}} @@ -100,8 +100,8 @@ <td>{{$probeInfo.Interval}}</td> <td data-sort="{{$probeInfo.TimeSinceLast.Milliseconds}}"> {{if $probeInfo.TimeSinceLast}} - {{$probeInfo.TimeSinceLast.String}}<br/> - <span class="small">{{$probeInfo.End}}</span> + {{$probeInfo.TimeSinceLast.String}} ago<br/> + <span class="small">{{$probeInfo.End.Format "2006-01-02T15:04:05Z07:00"}}</span> {{else}} Never {{end}} |
