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

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

Issue 2918353002: Swarming UI: Added piechart for timing information. (Closed)
Patch Set: Created 3 years, 6 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
« appengine/swarming/ui/package.json ('K') | « appengine/swarming/ui/package.json ('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..7b60f14e3cc3684232ac37050d0b57a5f29637c6 100644
--- a/appengine/swarming/ui/res/imp/taskpage/task-page.html
+++ b/appengine/swarming/ui/res/imp/taskpage/task-page.html
@@ -32,6 +32,7 @@
<link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html">
<link rel="import" href="/res/imp/bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="/res/imp/bower_components/polymer/polymer.html">
+<link rel="import" href="/res/imp/bower_components/svg-piechart/svg-piechart.html">
<link rel="import" href="/res/imp/common/common-behavior.html">
<link rel="import" href="/res/imp/common/interval-timer.html">
@@ -236,38 +237,6 @@
quarantined)
</td>
</tr>
- <tr>
- <td>Created</td>
- <td title$="[[_request.created_ts]]">[[_request.human_created_ts]]</td>
- </tr>
- <template is="dom-if" if="[[_wasPickedUp(_result)]]">
- <tr>
- <td>Started</td>
- <td title$="[[_result.started_ts]]">[[_result.human_started_ts]]</td>
- </tr>
- </template>
- <template is="dom-if" if="[[_wasNotPickedUp(_result)]]">
- <tr>
- <td>Expires</td>
- <td>[[_expires(_request)]]</td>
- </tr>
- </template>
- <template is="dom-if" if="[[_result.human_completed_ts]]">
- <tr>
- <td>Completed</td>
- <td title$="[[_result.completed_ts]]">[[_result.human_completed_ts]]</td>
- </tr>
- </template>
- <template is="dom-if" if="[[_result.human_abandoned_ts]]">
- <tr>
- <td>Abandoned</td>
- <td title$="[[_result.abandoned_ts]]">[[_result.human_abandoned_ts]]</td>
- </tr>
- </template>
- <tr>
- <td>Last Updated</td>
- <td title$="[[_result.modified_ts]]">[[_result.human_modified_ts]]</td>
- </tr>
<template is="dom-if" if="[[_result.deduped_from]]">
<tr>
<td><b>Deduped from</b></td>
@@ -278,14 +247,6 @@
</td>
</tr>
</template>
- <tr>
- <td>Pending Time</td>
- <td>[[_pending(_result)]]</td>
- </tr>
- <tr>
- <td>Duration</td>
- <td>[[_result.human_duration]]</td>
- </tr>
<tr>
<td>Priority</td>
<td>[[_request.priority]]</td>
@@ -456,6 +417,63 @@
</tbody>
</table>
+ <div class="title" hidden$="[[_not(_task_exists)]]">Task Timing Information</div>
+ <div class="horizontal layout wrap">
+ <div class="left flex">
+ <table class="task-info" hidden$="[[_not(_task_exists)]]">
+ <tbody>
+ <tr>
+ <td>Created</td>
+ <td title$="[[_request.created_ts]]">[[_request.human_created_ts]]</td>
+ </tr>
+ <template is="dom-if" if="[[_wasPickedUp(_result)]]">
+ <tr>
+ <td>Started</td>
+ <td title$="[[_result.started_ts]]">[[_result.human_started_ts]]</td>
+ </tr>
+ </template>
+ <template is="dom-if" if="[[_wasNotPickedUp(_result)]]">
+ <tr>
+ <td>Expires</td>
+ <td>[[_expires(_request)]]</td>
+ </tr>
+ </template>
+ <template is="dom-if" if="[[_result.human_completed_ts]]">
+ <tr>
+ <td>Completed</td>
+ <td title$="[[_result.completed_ts]]">[[_result.human_completed_ts]]</td>
+ </tr>
+ </template>
+ <template is="dom-if" if="[[_result.human_abandoned_ts]]">
+ <tr>
+ <td>Abandoned</td>
+ <td title$="[[_result.abandoned_ts]]">[[_result.human_abandoned_ts]]</td>
+ </tr>
+ </template>
+ <tr>
+ <td>Last updated</td>
+ <td title$="[[_result.modified_ts]]">[[_result.human_modified_ts]]</td>
+ </tr>
+ <tr>
+ <td>Pending Time</td>
+ <td>[[_pending(_result)]]</td>
+ </tr>
+ <tr>
+ <td>Duration</td>
+ <td>[[_result.human_duration]]</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="right flex">
+ <template is="dom-if" if="[[_result.human_completed_ts]]">
+ <center>
+ <svg-piechart data="[[_computePiechartData(_result)]]" colors="[&quot;rgb(238,135,136)&quot;, &quot;rgb(30,120,180)&quot;]"></svg-piechart>
Ryan Tseng 2017/06/06 00:22:07 nit: <svg-piechart data="..." colors="..."
ayanaadylova 2017/06/06 01:25:02 Done.
+ </center>
+ </template>
+ </div>
+ </div>
+
<div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</div>
<template is="dom-if" if="[[_wasPickedUp(_result)]]">
<table hidden$="[[_not(_task_exists)]]">
@@ -674,6 +692,7 @@
type: Boolean,
value: false,
},
+
_dialog_prompt: {
type: String,
value: "",
@@ -805,6 +824,38 @@
return args.join(" ");
},
+ _convertToInteger: function(time) {
Sergey Berezin 2017/06/06 00:17:13 Delete this function, it's no longer used.
ayanaadylova 2017/06/06 01:25:02 Done.
+ if (time == "") {
+ return 0;
+ }
+ var args = time.split(" ");
+ var sec = 0;
+ args.forEach(function(element) {
+ if (element.includes("h")){
+ element = element.substring(0, element.length - 1);
+ sec += parseInt(element)*60*60;
+ }
+ if (element.includes("m")){
+ element = element.substring(0, element.length - 1);
+ sec += parseInt(element)*60;
+ }
+ if (element.includes("s")){
+ element = element.substring(0, element.length - 1);
+ sec += parseInt(element);
+ }
+ });
+ return sec;
+ },
+
+ _computePiechartData: function(result) {
+ var created = new Date(result.created_ts);
+ var started = new Date(result.started_ts);
+ var completed = new Date(result.completed_ts);
+ return [
+ this._duration(created, started),
+ this._duration(started, completed)];
+ },
+
_cost: function(result) {
if (!result || !result.costs_usd || !result.costs_usd.length) {
return 0;
@@ -819,6 +870,10 @@
return result.try_number > 1;
},
+ _duration: function(start, end) {
+ return end.getTime() - start.getTime();
+ },
+
_empty: function(array) {
return !array || array.length == 0;
},
« appengine/swarming/ui/package.json ('K') | « appengine/swarming/ui/package.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698