Skip to content

Commit

Permalink
Add tooltip with itp and cores/itp to homepage
Browse files Browse the repository at this point in the history
This allows more advanced users to keep a closer eye on the server without confusing new viewers
  • Loading branch information
dubslow committed Feb 14, 2023
1 parent 5d041c2 commit c5cffd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def aggregate_unfinished_runs(self, username=None):
runs["pending"].sort(
key=lambda run: (
run["args"]["priority"],
run["args"]["itp"] if "itp" in run["args"] else 100,
run["args"].get("itp", 100),
)
)
runs["active"].sort(
Expand All @@ -511,8 +511,7 @@ def aggregate_unfinished_runs(self, username=None):
)

# Calculate but don't save results_info on runs using info on current machines
cores = 0
nps = 0
cores = itp = nps = 0
for m in self.get_machines():
concurrency = int(m["concurrency"])
cores += concurrency
Expand All @@ -522,18 +521,19 @@ def aggregate_unfinished_runs(self, username=None):
if cores > 0:
eta = remaining_hours(run) / cores
pending_hours += eta
itp += run["args"].get("itp", 0)
results = self.get_results(run, False)
run["results_info"] = format_results(results, run)
if "Pending..." in run["results_info"]["info"]:
if cores > 0:
run["results_info"]["info"][0] += " ({:.1f} hrs)".format(eta)
run["results_info"]["info"][0] += f" ({eta:.1f} hrs)"
if "sprt" in run["args"]:
sprt = run["args"]["sprt"]
elo_model = sprt.get("elo_model", "BayesElo")
run["results_info"]["info"].append(
format_bounds(elo_model, sprt["elo0"], sprt["elo1"])
)
return (runs, pending_hours, cores, nps)
return (runs, pending_hours, cores, itp, nps)

def get_finished_runs(
self,
Expand Down
2 changes: 1 addition & 1 deletion server/fishtest/templates/tests.mak
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="col-6 col-sm">
<div class="card card-lg-sm text-center">
<div class="card-header text-nowrap" title="Cores">Cores</div>
<div class="card-body">
<div class="card-body" title="itp=${int(itp)}, c/i=${f"{cores/itp:.2f}"}">
<h4 class="card-title mb-0 monospace">${cores}</h4>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions server/fishtest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,13 +1392,14 @@ def homepage_results(request):
)
)
# Get updated results for unfinished runs + finished runs
(runs, pending_hours, cores, nps) = request.rundb.aggregate_unfinished_runs()
(runs, pending_hours, cores, itp, nps) = request.rundb.aggregate_unfinished_runs()
return {
**get_paginated_finished_runs(request),
"runs": runs,
"machines": machines,
"pending_hours": "{:.1f}".format(pending_hours),
"pending_hours": f"{pending_hours:.1f}",
"cores": cores,
"itp": itp,
"nps": nps,
"games_per_minute": int(games_per_minute),
}
Expand Down

0 comments on commit c5cffd4

Please sign in to comment.