Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltip with itp and cores/itp to homepage #1566

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", 100)
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="${f"itp: {itp:d}, c/i: {cores/itp:.2f}"}">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- <div class="card-body" title="${f"itp: {itp:d}, c/i: {cores/itp:.2f}"}">
+ <div class="card-body" title="${f'itp: {itp:.0f}, c/i: {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