blob: 95db06f8e674af28278b2c3da262578f8f47f364 [file] [log] [blame]
<!--
Copyright 2019 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<link href="/static/css/worker.css" rel="stylesheet">
<title>{{.Env}} Worker</title>
<body>
<h1>{{.Env}} Worker</h1>
<p>All times in America/New_York.</p>
<p>
<a href="/">
Home
</a> |
<a href="/versions">
Recent Versions
</a> |
<a href="https://cloud.google.com/console/cloudtasks/queue/{{.LocationID}}/{{.ResourcePrefix}}fetch-tasks?project={{.Config.ProjectID}}"
target="_blank" rel="noreferrer">
Task Queue
</a> |
<a href="https://cloud.google.com/console/cloudscheduler?project={{.Config.ProjectID}}"
target="_blank" rel="noreferrer">
Scheduler
</a> |
<a href="https://cloud.google.com/console/logs/viewer?project={{.Config.ProjectID}}&resource=gae_app%2Fmodule_id%2F{{.Config.ServiceID}}"
target="_blank" rel="noreferrer">
Logs (switch to "All Logs" when you get there)
</a>
</p>
<div>
<form action="/poll" method="post" name="pollForm">
<button title="Poll the module index for up to 2000 new versions."
onclick="submitForm('pollForm', false); return false">Poll Module Index</button>
<input type="number" name="limit" value="10"></input>
<output name="result"></output>
</form>
<form action="/enqueue" method="post" name="enqueueForm">
<button title="Query the discovery database for new or failed versions, and enqueue them for processing."
onclick="submitForm('enqueueForm', true); return false">Enqueue New and Failed Versions</button>
<input type="number" name="limit" value="10">
<output name="result"></output>
</form>
<form action="/reprocess" method="post" name="reprocessForm">
<button title="Mark all versions created before the specified app_version to be reprocessed."
onclick="submitForm('reprocessForm', true); return false">Reprocess Versions</button>
<input type="text" name="app_version">
<output name="result"></output>
</form>
<form action="/populate-stdlib" method="post" name="populateStdlibForm">
<button title="Populates the database with all supported versions of the Go standard library."
onclick="submitForm('populateStdlibForm', false); return false">Populate Standard Library</button>
<output name="result"></output>
</form>
<form action="/clear-cache" method="get" name="clearCacheForm">
<button title="Clears the Redis cache."
onclick="submitForm('clearCacheForm', false); return false">Clear Cache</button>
<output name="result"></output>
</form>
</div>
<div>
<h3>Config</h3>
<table>
<tr><td>App Version</td><td>{{.Config.VersionID}}</td></tr>
<tr><td>Zone</td><td>{{.Config.ZoneID}}</td></tr>
<tr><td>DB Host</td><td>{{.Config.DBHost}}</td></tr>
<tr><td>Redis Cache Host</td><td>{{.Config.RedisCacheHost}}</td></tr>
<tr><td>Redis HA Host</td><td>{{.Config.RedisHAHost}}</td></tr>
</table>
</div>
<div class="Experiments">
<h3>Experiments</h3>
{{if .Experiments}}
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Rollout</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{range .Experiments}}
<form action="/update-experiment" method="post" target="experimentUpdateResult">
<tr>
<td>{{.Name}}<input name="name" value="{{.Name}}" readonly hidden></td>
<td>{{.Description}}<input name="description" value="{{.Description}}" readonly hidden></td>
<td><input name="rollout" size="1rem" type="number" min="0" max="100" step="1" pattern="[0-9]{0,3}" value="{{.Rollout}}" required></td>
<td><button>Update</button></td>
</tr>
</form>
{{end}}
</tbody>
</table>
{{else}}
<p>No experiments.</p>
{{end}}
<iframe class="Experiments-updateResult" name="experimentUpdateResult" id="experimentUpdateResult"></iframe>
</div>
<div>
<h3>Load Shedding</h3>
<table>
<tr><td>Fetches In Flight</td><td>{{.LoadShedStats.RequestsInFlight}}</td></tr>
<tr>
<td>Zip Bytes In Flight</td>
<td>{{.LoadShedStats.SizeInFlight | bytesToMi}} /
{{.LoadShedStats.MaxSizeInFlight | bytesToMi}} Mi
({{pct .LoadShedStats.SizeInFlight .LoadShedStats.MaxSizeInFlight}}%) </td>
</tr>
<tr>
<td>Shedded Requests</td>
<td>{{.LoadShedStats.RequestsShed}} / {{.LoadShedStats.RequestsTotal}}
({{pct .LoadShedStats.RequestsShed .LoadShedStats.RequestsTotal}}%)</td>
</tr>
</table>
</div>
<div>
<h3>Memory</h3>
<table>
<tr><td>Go Heap</td><td>{{.GoMemStats.HeapAlloc | bytesToMi}} Mi</td></tr>
<tr><td>Process Virtual</td><td>{{.ProcessStats.VSize | bytesToMi}} Mi</td></tr>
<tr><td>Process RSS</td><td>{{.ProcessStats.RSS | bytesToMi}} Mi</td></tr>
<tr><td>System Free</td><td>{{.SystemStats.Free | bytesToMi}} Mi</td></tr>
<tr><td>System Used</td><td>{{.SystemStats.Used | bytesToMi}} Mi</td></tr>
<tr><td>System Available</td><td>{{.SystemStats.Available | bytesToMi}} Mi</td></tr>
</table>
</div>
<div>
<h3>Excluded Prefixes</h3>
{{if .Excluded}}
<table>
<thead>
<tr><th>Prefix</th></tr>
</thead>
<tbody>
{{range .Excluded}}
<tr><td>{{.}}</td></tr>
{{end}}
</tbody>
</table>
{{else}}
<p>No excluded prefixes.</p>
{{end}}
</div>
</body>
<script>
function loadScript(src) {
let s = document.createElement("script");
s.src = src;
document.head.appendChild(s);
}
loadScript("/static/js/worker.js");
</script>