You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2016/01/25 00:29:10 UTC
[02/50] storm git commit: [STORM-1472] Fix the errorTime bug and show
the time to be readable
[STORM-1472] Fix the errorTime bug and show the time to be readable
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/b48f02e3
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/b48f02e3
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/b48f02e3
Branch: refs/heads/1.x-branch
Commit: b48f02e39dcbec62a29da6989c98e004b6b1c940
Parents: 6fcebe6
Author: zhuol <zh...@yahoo-inc.com>
Authored: Wed Jan 13 20:52:59 2016 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Wed Jan 13 20:52:59 2016 -0600
----------------------------------------------------------------------
storm-core/src/clj/org/apache/storm/ui/core.clj | 2 +-
storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java | 4 +++-
storm-core/src/ui/public/component.html | 9 +++++++++
.../src/ui/public/templates/component-page-template.html | 4 +++-
4 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/b48f02e3/storm-core/src/clj/org/apache/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/ui/core.clj b/storm-core/src/clj/org/apache/storm/ui/core.clj
index b309b2c..9bdc0e9 100644
--- a/storm-core/src/clj/org/apache/storm/ui/core.clj
+++ b/storm-core/src/clj/org/apache/storm/ui/core.clj
@@ -646,7 +646,7 @@
reverse)]
{"componentErrors"
(for [^ErrorInfo e errors]
- {"time" (* 1000 (long (.get_error_time_secs e)))
+ {"errorTime" (* 1000 (long (.get_error_time_secs e)))
"errorHost" (.get_host e)
"errorPort" (.get_port e)
"errorWorkerLogLink" (worker-log-link (.get_host e)
http://git-wip-us.apache.org/repos/asf/storm/blob/b48f02e3/storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java b/storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java
index 3650df2..3495770 100644
--- a/storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java
+++ b/storm-core/src/jvm/org/apache/storm/scheduler/Cluster.java
@@ -32,11 +32,13 @@ import org.apache.storm.utils.Utils;
public class Cluster {
/**
- * key: supervisor id, value: supervisor details
+ * key: supervisor id,
+ * value: supervisor's total and used resources, i.e. {totalMem, totalCpu, usedMem, usedCpu}
*/
private Map<String, SupervisorDetails> supervisors;
/**
* key: supervisor id, value: supervisor's total and used resources
+ * value: {requestedMemOnHeap, requestedMemOffHeap, requestedCpu, assignedMemOnHeap, assignedMemOffHeap, assignedCpu}
*/
private Map<String, Double[]> supervisorsResources;
http://git-wip-us.apache.org/repos/asf/storm/blob/b48f02e3/storm-core/src/ui/public/component.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/component.html b/storm-core/src/ui/public/component.html
index 964eacb..06c485c 100644
--- a/storm-core/src/ui/public/component.html
+++ b/storm-core/src/ui/public/component.html
@@ -298,6 +298,15 @@ $(document).ready(function() {
//time, error
dtAutoPage("#component-errors-table", {});
+ var errorTimeCells = document.getElementsByClassName("errorTimeSpan");
+ for (i = 0; i < errorTimeCells.length; i++)
+ {
+ var timeInMilliseconds = errorTimeCells[i].id;
+ var time = parseInt(timeInMilliseconds);
+ var date = new Date(time);
+ errorTimeCells[i].innerHTML = date.toJSON();
+ }
+
var errorCells = document.getElementsByClassName("errorSpan");
for (i =0; i < errorCells.length; i++)
{
http://git-wip-us.apache.org/repos/asf/storm/blob/b48f02e3/storm-core/src/ui/public/templates/component-page-template.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/templates/component-page-template.html b/storm-core/src/ui/public/templates/component-page-template.html
index e852eeb..79a21cd 100644
--- a/storm-core/src/ui/public/templates/component-page-template.html
+++ b/storm-core/src/ui/public/templates/component-page-template.html
@@ -539,7 +539,9 @@
<tbody>
{{#componentErrors}}
<tr>
- <td>{{errorTime}}</td>
+ <td>
+ <span id="{{errorTime}}" class="errorTimeSpan">{{errorTime}}</span>
+ </td>
<td>{{errorHost}}</td>
<td><a href="{{errorWorkerLogLink}}">{{errorPort}}</a></td>
<td>