Skip to content

Commit

Permalink
Merge branch 'show-recent-error' of https://github.com/kishorvpatil/i…
Browse files Browse the repository at this point in the history
…ncubator-storm into STORM-366

Conflicts:
	STORM-UI-REST-API.md

STORM-366: Add color span to most recent error and fix ui templates.
  • Loading branch information
revans2 committed Jul 30, 2014
2 parents b2a8a77 + 6b50a7f commit af58c3b
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 32 deletions.
46 changes: 22 additions & 24 deletions STORM-UI-REST-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,22 @@ Response Fields:
|spouts.transferred| Long |Total number of messages transferred in given window|
|spouts.tasks| Integer |Total number of tasks for the spout|
|spouts.lastError| String |Shows the last error happened in a spout|
|spouts.errorLapsedSecs| Integer | Number of seconds elapsed since that last error happened in a spout|
|spouts.errorWorkerLogLink| String | Link to the worker log that reported the exception |
|spouts.acked| Long |Number of messages acked|
|spouts.failed| Long |Number of messages failed|
|bolts| Array | Array of bolt components in the topology|
|bolts.boltId| String |Bolt id|
|bolts.capacity| String (double value returned in String format) |This value indicates number of mesages executed * average execute latency / time window|
|bolts.capacity| String (double value returned in String format) |This value indicates number of messages executed * average execute latency / time window|
|bolts.processLatency| String (double value returned in String format) |Bolt's average time to ack a message after it's received|
|bolts.executeLatency| String (double value returned in String format) |Average time for bolt's execute method |
|bolts.executors| Integer |Number of executor tasks in the bolt component|
|bolts.tasks| Integer |Number of instances of bolt|
|bolts.acked| Long |Number of tuples acked by the bolt|
|bolts.failed| Long |Number of tuples failed by the bolt|
|bolts.lastError| String |Shows the last error occured in the bolt|
|bolts.lastError| String |Shows the last error occurred in the bolt|
|bolts.errorLapsedSecs| Integer |Number of seconds elapsed since that last error happened in a bolt|
|bolts.errorWorkerLogLink| String | Link to the worker log that reported the exception |
|bolts.emitted| Long |Number of tuples emitted|


Expand Down Expand Up @@ -246,6 +250,7 @@ Sample Response:
"spoutId": "spout",
"tasks": 5,
"lastError": "",
"errorLapsedSecs": null
"failed": 0
}
],
Expand All @@ -261,6 +266,7 @@ Sample Response:
"processLatency": "0.043",
"boltId": "count",
"lastError": "",
"errorLapsedSecs": null
"capacity": "0.003",
"failed": 0
},
Expand All @@ -275,6 +281,7 @@ Sample Response:
"processLatency": "2.112",
"boltId": "split",
"lastError": "",
"errorLapsedSecs": null
"capacity": "0.000",
"failed": 0
}
Expand Down Expand Up @@ -341,9 +348,13 @@ Response Fields:
|componentType | String | component's type SPOUT or BOLT|
|windowHint| String | window param value in "hh mm ss" format. Default value is "All Time"|
|executors| Integer |Number of executor tasks in the component|
|componentErrors| Array of Strings | List of component errors|
|componentErrors| Array of Errors | List of component errors|
|componentErrors.time| Long | Timestamp when the exception occurred |
|componentErrors.error| String | The stack trace of an exception info |
|componentErrors.errorHost| String | host name for the error|
|componentErrors.errorPort| String | port for the error|
|componentErrors.error| String |Shows the error happened in a component|
|componentErrors.errorLapsedSecs| Integer | Number of seconds elapsed since the error happened in a component |
|componentErrors.errorWorkerLogLink| String | Link to the worker log that reported the exception |
|topologyId| String | Topology's Id|
|tasks| Integer |Number of instances of component|
|window |String. Default value "All Time" | window duration for metrics in seconds|
Expand Down Expand Up @@ -377,26 +388,13 @@ Sample Response:
"componentType": "spout",
"windowHint": "10m 0s",
"executors": 5,
"componentErrors": [
{
"time":1406006074000,
"error":"java.lang.RuntimeException: java.lang.NullPointerException
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:84)
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:55)
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:56)
at backtype.storm.disruptor$consume_loop_STAR_$fn__1597.invoke(disruptor.clj:67)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at backtype.storm.serialization.SerializationFactory$IdDictionary.getStreamName(SerializationFactory.java:137)
at backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:34)
at backtype.storm.daemon.executor$mk_task_receiver$fn__3967.invoke(executor.clj:311)
at backtype.storm.disruptor$clojure_handler$reify__1585.onEvent(disruptor.clj:43)
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:81)
... 6 more"
}
],
"componentErrors":[{"time": 1406006074000,
"errorHost": "10.11.1.70",
"errorPort": 6701,
"errorWorkerLogLink": "http://10.11.1.7:8000/log?file=worker-6701.log",
"errorLapsedSecs": 16,
"error": "java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: Some Error\n\tat backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)\n\tat backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)\n\tat backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)\n\tat backtype...more.."
}],
"topologyId": "WordCount3-1-1402960825",
"tasks": 5,
"window": "600",
Expand Down
11 changes: 6 additions & 5 deletions storm-core/src/clj/backtype/storm/ui/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,10 @@
(map nil-to-zero)
(apply max)))

(defn get-error-span
(defn get-error-time
[error]
(if (and error (< (time-delta (.get_error_time_secs ^ErrorInfo error))
(* 60 30)))
{:class "red"}
{}))
(if error
(time-delta (.get_error_time_secs ^ErrorInfo error))))

(defn get-error-data
[error]
Expand Down Expand Up @@ -562,6 +560,7 @@
"errorHost" error-host
"errorPort" error-port
"errorWorkerLogLink" (worker-log-link error-host error-port)
"errorLapsedSecs" (get-error-time last-error)
"lastError" (get-error-data last-error) }))

(defn bolt-comp [top-id summ-map errors window include-sys?]
Expand All @@ -587,6 +586,7 @@
"errorHost" error-host
"errorPort" error-port
"errorWorkerLogLink" (worker-log-link error-host error-port)
"errorLapsedSecs" (get-error-time last-error)
"lastError" (get-error-data last-error) }))

(defn topology-summary [^TopologyInfo summ]
Expand Down Expand Up @@ -692,6 +692,7 @@
"errorHost" (.get_host e)
"errorPort" (.get_port e)
"errorWorkerLogLink" (worker-log-link (.get_host e) (.get_port e))
"errorLapsedSecs" (get-error-time e)
"error" (.get_error e)})}))

(defn spout-stats
Expand Down
10 changes: 10 additions & 0 deletions storm-core/src/ui/public/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ <h1><a href="/">Storm UI</a></h1>
if(response["componentErrors"].length > 0) {
$("#component-errors-table").tablesorter({ sortList: [[0,0]], headers: {1: { sorter: "stormtimestr"}}});
}

var errorCells = document.getElementsByClassName("errorSpan");
for (i =0; i < errorCells.length; i++)
{
var timeLapsedInSecs = errorCells[i].id;
if (parseInt(timeLapsedInSecs) < 1800) {
errorCells[i].style.color = "#9d261d";
errorCells[i].style.borderBottomColor = "#9d261d";
}
}
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ <h2>Errors</h2>
<td>{{time}}</td>
<td>{{errorHost}}</td>
<td><a href="{{errorWorkerLogLink}}">{{errorPort}}</a></td>
<td>{{error}}</td>
<td>
<span id="{{errorLapsedSecs}}" class="errorSpan">{{error}}</span>
</td>
</tr>
{{/componentErrors}}
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ <h2>Spouts ({{windowHint}})</h2>
<td>{{failed}}</td>
<td>{{errorHost}}</td>
<td><a href="{{errorWorkerLogLink}}">{{errorPort}}</a></td>
<td>{{lastError}}</td>
<td>
<span id="{{errorLapsedSecs}}" class="errorSpan">{{lastError}}</span>
</td>
{{/spouts}}
</tbody>
</table>
Expand All @@ -138,7 +140,9 @@ <h2>Bolts ({{windowHint}})</h2>
<td>{{failed}}</td>
<td>{{errorHost}}</td>
<td><a href="{{errorWorkerLogLink}}">{{errorPort}}</a></td>
<td>{{lastError}}</td>
<td>
<span id="{{errorLapsedSecs}}" class="errorSpan">{{lastError}}</span>
</td>
{{/bolts}}
</tbody>
</script>
Expand Down
10 changes: 10 additions & 0 deletions storm-core/src/ui/public/topology.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ <h2 class="js-only">Topology actions</h2>

config.append(Mustache.render($(template).filter("#topology-configuration-template").html(),formattedConfig));
$("#topology-configuration-table").tablesorter({ sortList: [[0,0]], headers: {}});

var errorCells = document.getElementsByClassName("errorSpan");
for (i =0; i < errorCells.length; i++)
{
var timeLapsedInSecs = errorCells[i].id;
if (parseInt(timeLapsedInSecs) < 1800) {
errorCells[i].style.color = "#9d261d";
errorCells[i].style.borderBottomColor = "#9d261d";
}
}
});
});
});
Expand Down

0 comments on commit af58c3b

Please sign in to comment.