Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2575)

Unified Diff: appengine/swarming/ui/res/imp/taskpage/task-page.html

Issue 2921433002: Add in similar load (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/swarming/ui/res/imp/common/common-behavior.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/ui/res/imp/taskpage/task-page.html
diff --git a/appengine/swarming/ui/res/imp/taskpage/task-page.html b/appengine/swarming/ui/res/imp/taskpage/task-page.html
index 3a042a58ffc650bd456cca1c0c39751762de6912..bed9c40613bd7e69c9f8e4090ed1388a14391c43 100644
--- a/appengine/swarming/ui/res/imp/taskpage/task-page.html
+++ b/appengine/swarming/ui/res/imp/taskpage/task-page.html
@@ -211,17 +211,28 @@
<td>State</td>
<td class$="[[_stateClass(_result)]]">[[state(_result)]]</td>
</tr>
- <template is="dom-if" if="[[_eq(_result.state,'PENDING')]]">
+
<tr>
- <td><b>Why Pending?</b></td>
<td>
- <span class$="[[_it(_other_pending.count)]]">[[_otherPending(_other_pending)]]</span>
- similar pending tasks,
+ <template is="dom-if" if="[[_eq(_result.state,'PENDING')]]">
+ <b>Why Pending?</b>
+ </template>
+ <template is="dom-if" if="[[_neq(_result.state,'PENDING')]]">
+ Similar Load
+ </template>
+ </td>
+ <td>
+ <span class$="[[_it(_other_pending.count)]]">[[_other_pending.count]]</span>
+ <a
+ title="The list of pending tasks that matches the list of dimensions"
+ href$='[[_taskListLink(_request.properties.dimensions,"","state:PENDING")]]'>similar pending tasks</a>,
<span class$="[[_it(_other_running.count)]]">[[_other_running.count]]</span>
- similar running tasks
+ <a
+ title="The list of running tasks that matches the list of dimensions"
+ href$='[[_taskListLink(_request.properties.dimensions,"","state:RUNNING")]]'>similar running tasks</a>
</td>
</tr>
- </template>
+
<tr>
<td>Fleet Capacity</td>
<td>
@@ -320,11 +331,13 @@
</template>
<tr>
<td rowspan$="[[_rowspan(_request.properties.dimensions)]]">
+ Dimensions <br/>
<a
title="The list of bots that matches the list of dimensions"
- href$="[[_botListLink(_request.properties.dimensions)]]">
- Requested Dimensions
- </a>
+ href$="[[_botListLink(_request.properties.dimensions)]]">Bots</a>
+ <a
+ title="The list of tasks that matches the list of dimensions"
+ href$="[[_taskListLink(_request.properties.dimensions)]]">Tasks</a>
</td>
</tr>
<template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimension">
@@ -721,7 +734,7 @@
},
observers: [
- "_whyPending(_request,_result,_auth_headers)"],
+ "_similarLoad(_request,_result,_auth_headers)"],
_alias: function(dim) {
var values = dim.value;
@@ -889,18 +902,14 @@
return "";
},
+ _neq: function(a,b) {
+ return a !== b;
+ },
+
_noMilo: function(result) {
return !(this._tag(result, "allow_milo") || this._tag(result, "luci_project"));
},
- _otherPending: function(other_pending) {
- if (other_pending && other_pending.count > 0) {
- // subtract 1 from this count, because that's this task.
- return other_pending.count - 1;
- }
- return "<counting>";
- },
-
_pending: function(result) {
if (!result.created_ts) {
return "";
@@ -1032,7 +1041,7 @@
return result && !this._wasPickedUp(result);
},
- _whyPending: function() {
+ _similarLoad: function() {
if (!this._request || !this._result || !this._auth_headers) {
return;
}
@@ -1047,25 +1056,23 @@
});
this._getJsonAsync("_bots_count", "/api/swarming/v1/bots/count", "_busyBotCount", this._auth_headers, botCountParams);
- if (result && result.state === "PENDING") {
- var start = new Date();
- start.setSeconds(0);
- // go back 24 hours, rounded to the nearest minute for better caching.
- start = "" + (start.getTime() - 24*60*60*1000);
- // convert to seconds, because that's what the API expects.
- start = start.substring(0, start.length-3);
+ var start = new Date();
+ start.setSeconds(0);
+ // go back 24 hours, rounded to the nearest minute for better caching.
+ start = "" + (start.getTime() - 24*60*60*1000);
+ // convert to seconds, because that's what the API expects.
+ start = start.substring(0, start.length-3);
- var taskCountParams = {
- start: [start],
- state: ["RUNNING"],
- tags: botCountParams.dimensions,
- };
+ var taskCountParams = {
+ start: [start],
+ state: ["RUNNING"],
+ tags: botCountParams.dimensions,
+ };
- this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_busyRunningCount", this._auth_headers, taskCountParams);
- // change running to pending
- taskCountParams.state = ["PENDING"];
- this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_busyPendingCount", this._auth_headers, taskCountParams);
- }
+ this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_busyRunningCount", this._auth_headers, taskCountParams);
+ // change running to pending
+ taskCountParams.state = ["PENDING"];
+ this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_busyPendingCount", this._auth_headers, taskCountParams);
}
});
})();
« no previous file with comments | « appengine/swarming/ui/res/imp/common/common-behavior.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698