| 1 | {{define "app_availability"}}{{template "top" .}} |
| 2 | {{if .Flash}}<p class="banner">{{.Flash}}</p>{{end}} |
| 3 | {{if .FlashErr}}<p class="banner error">{{.FlashErr}}</p>{{end}} |
| 4 | {{template "appnav" .}} |
| 5 | {{template "lognav" .}} |
| 6 | |
| 7 | <h2 class="visually-hidden">Availability</h2> |
| 8 | {{if .ErrsErr}}<p class="banner error">{{.ErrsErr}}</p>{{end}} |
| 9 | <form method="get" class="small"> |
| 10 | <label>from the last |
| 11 | <select name="since"> |
| 12 | <option value="1h"{{if eq .ErrSince "1h"}} selected{{end}}>hour</option> |
| 13 | <option value="24h"{{if eq .ErrSince "24h"}} selected{{end}}>day</option> |
| 14 | <option value="168h"{{if eq .ErrSince "168h"}} selected{{end}}>week</option> |
| 15 | </select> |
| 16 | </label> |
| 17 | <label>host <input name="host" value="{{.ErrHost}}" size="24"></label> |
| 18 | <button type="submit">Update</button> |
| 19 | </form> |
| 20 | <p class="small">Requests an instance could not answer — a 502, 503 or 504 — grouped by cause rather than by page, and the platform's own events about the instance: failed wakes and exits. |
| 21 | A 500 is the app answering, and stays on Errors. A visitor who left within five seconds is not counted; one who gave up after waiting longer is. Counts are to the nearest flush.</p> |
| 22 | |
| 23 | {{if .ErrFP}} |
| 24 | {{with .ErrWin.Records}} |
| 25 | <h3>Occurrences</h3> |
| 26 | <p class="small"><a href="?since={{$.ErrSince}}{{if $.ErrHost}}&host={{$.ErrHost}}{{end}}">All causes</a></p> |
| 27 | {{if $.ErrWin.Truncated}}<p class="small">Showing the newest {{len $.ErrWin.Records}} occurrences of a larger window — narrow the window, or use <code>carlos availability</code> for all of them.</p>{{end}} |
| 28 | {{range .}} |
| 29 | <div class="tablewrap"><table> |
| 30 | <tr><th>Last</th><td>{{.Last.UTC.Format "2006-01-02 15:04:05"}}</td></tr> |
| 31 | <tr><th>Count</th><td>{{.Count}}</td></tr> |
| 32 | <tr><th>Host</th><td>{{.Host}}</td></tr> |
| 33 | {{if .Release}}<tr><th>Release</th><td>{{.Release}}</td></tr>{{end}} |
| 34 | {{if .Path}}<tr><th>Path</th><td><code>{{.Path}}</code>{{if gt .Count 1}} <span class="small">(the first of these {{.Count}})</span>{{end}}</td></tr>{{end}} |
| 35 | <tr><th>What happened</th><td>{{.Name}}</td></tr> |
| 36 | <tr><th>Logs</th><td><a href="{{$.Nav}}/apps/{{$.AppName}}/logs?since=1h&host={{.Host}}">around this time</a></td></tr> |
| 37 | </table></div> |
| 38 | {{end}} |
| 39 | {{else}}<p>No occurrences of this cause in the window.</p>{{end}} |
| 40 | {{else if .ErrWin.Groups}} |
| 41 | {{if .ErrWin.Truncated}}<p class="small">Showing {{len .ErrWin.Groups}} causes of a larger window — counts are within what was read. Narrow the window, or use <code>carlos availability</code> for all of them.</p>{{end}} |
| 42 | <div class="tablewrap"> |
| 43 | <table> |
| 44 | <tr><th>Last seen</th><th>First seen</th><th>Count</th><th>From</th><th>What happened</th><th>Hosts</th><th>Releases</th></tr> |
| 45 | {{range .ErrWin.Groups}}<tr> |
| 46 | <td>{{.Last.UTC.Format "2006-01-02 15:04"}}</td> |
| 47 | <td>{{.First.UTC.Format "2006-01-02 15:04"}}</td> |
| 48 | <td>{{.Count}}{{if eq .FP "_overflow"}} <span class="small" title="occurrences beyond the hourly cap on distinct errors">(overflow)</span>{{end}}</td> |
| 49 | <td>{{if eq .Source "log"}}platform{{if .Level}} <span class="small">{{.Level}}</span>{{end}}{{else}}{{.Source}}{{end}}</td> |
| 50 | <td><a href="?since={{$.ErrSince}}&fp={{.FP}}{{if $.ErrHost}}&host={{$.ErrHost}}{{end}}">{{.Name}}</a></td> |
| 51 | <td>{{range $i, $h := .Hosts}}{{if $i}}, {{end}}{{$h}}{{end}}</td> |
| 52 | <td>{{range $i, $r := .Releases}}{{if $i}}, {{end}}<code>{{$r}}</code>{{end}}</td> |
| 53 | </tr>{{end}} |
| 54 | </table> |
| 55 | </div> |
| 56 | <p class="small">Times are UTC. The same view from a terminal: <code>carlos availability --app {{.AppName}} --since {{.ErrSince}}</code>.</p> |
| 57 | {{else if not .ErrsErr}} |
| 58 | <p>No availability problems in this window.</p> |
| 59 | <p class="small">The same view from a terminal: <code>carlos availability --app {{.AppName}}</code>.</p> |
| 60 | {{end}} |
| 61 | {{template "bottom" .}}{{end}} |
| 62 | |