Skip to content
Merged
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
2 changes: 1 addition & 1 deletion conf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ topology.enable.message.timeouts: true
topology.debug: false
topology.workers: 1
topology.acker.executors: null
topology.eventlogger.executors: null
topology.eventlogger.executors: 0
topology.tasks: null
# maximum amount of time a message has to complete before it's considered failed
topology.message.timeout.secs: 30
Expand Down
18 changes: 17 additions & 1 deletion storm-core/src/ui/public/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,26 @@ <h1><a href="/">Storm UI</a></h1>
$('#ui-user [data-toggle="tooltip"]').tooltip()
});

var topologyUrl = "/api/v1/topology/"+topologyId;

var eventLoggers = (function() {
$.ajaxSetup({
async: false
});
var eventLoggers;
$.getJSON(topologyUrl, function(response, status, jqXHR) {
eventLoggers = response["configuration"]["topology.eventlogger.executors"];
});
$.ajaxSetup({
async: true
})
return eventLoggers;
})();

var componentSummary = $("#component-summary");
var componentActions = $("#component-actions");
var buttonJsonData = componentActionJson(response["encodedTopologyId"], response["encodedId"], response["id"],
response["topologyStatus"], response["debug"], response["samplingPct"]);
response["topologyStatus"], eventLoggers, response["debug"], response["samplingPct"]);
var componentStatsDetail = $("#component-stats-detail")
var inputStats = $("#component-input-stats");
var outputStats = $("#component-output-stats");
Expand Down
10 changes: 6 additions & 4 deletions storm-core/src/ui/public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function renderToggleSys(div) {
}
}

function topologyActionJson(id, encodedId, name, status, msgTimeout, debug, samplingPct) {
function topologyActionJson(id, encodedId, name, status, msgTimeout, loggersTotal, debug, samplingPct) {
var jsonData = {};
jsonData["id"] = id;
jsonData["encodedId"] = encodedId;
Expand All @@ -220,19 +220,21 @@ function topologyActionJson(id, encodedId, name, status, msgTimeout, debug, samp
jsonData["deactivateStatus"] = (status === "ACTIVE") ? "enabled" : "disabled";
jsonData["rebalanceStatus"] = (status === "ACTIVE" || status === "INACTIVE" ) ? "enabled" : "disabled";
jsonData["killStatus"] = (status !== "KILLED") ? "enabled" : "disabled";
jsonData["startDebugStatus"] = (status === "ACTIVE" && !debug) ? "enabled" : "disabled";
jsonData["startDebugStatus"] = (status === "ACTIVE" && loggersTotal!=null && loggersTotal!=0 && !debug) ? "enabled" : "disabled";
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it disable the debug option even when topology.eventlogger.executors is set to null?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. I think we should remove loggersTotal != null so that "debug" is enabled if the value is set to null since one event logger task is created per worker if the value is set to null. This interpretation of "null" is not very intuitive, but its consistent with what "null" means with other variables like "topology.acker.executors".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the intent is to disable event logging by default, we should disable logging if topology.eventlogger.executors is null ... otherwise its confusing.

jsonData["stopDebugStatus"] = (status === "ACTIVE" && debug) ? "enabled" : "disabled";
jsonData["loggersDisabled"] = loggersTotal==null || loggersTotal==0;
jsonData["currentSamplingPct"] = samplingPct;
return jsonData;
}

function componentActionJson(encodedTopologyId, encodedId, componentName, status, debug, samplingPct) {
function componentActionJson(encodedTopologyId, encodedId, componentName, status, loggersTotal, debug, samplingPct) {
var jsonData = {};
jsonData["encodedTopologyId"] = encodedTopologyId;
jsonData["encodedId"] = encodedId;
jsonData["componentName"] = componentName;
jsonData["startDebugStatus"] = (status === "ACTIVE" && !debug) ? "enabled" : "disabled";
jsonData["startDebugStatus"] = (status === "ACTIVE" && loggersTotal!=null && loggersTotal!=0 && !debug) ? "enabled" : "disabled";
jsonData["stopDebugStatus"] = (status === "ACTIVE" && debug) ? "enabled" : "disabled";
jsonData["loggersDisabled"] = loggersTotal==null || loggersTotal==0;
jsonData["currentSamplingPct"] = samplingPct;
return jsonData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,13 @@ <h2>Errors</h2>
<script id="component-actions-template" type="text/html">
<h2>Component actions</h2>
<p id="component-actions">
<input {{startDebugStatus}} onclick="confirmComponentAction('{{encodedTopologyId}}', '{{encodedId}}', '{{componentName}}', 'debug/enable', true, {{currentSamplingPct}}, 'sampling percentage', 'debug')" type="button" value="Debug" class="btn btn-default">
{{#loggersDisabled}}
<span style="display:inline-block;" data-toggle="tooltip" title="" data-original-title="To debug, set topology.eventlogger.executors to a value > 0">
{{/loggersDisabled}}
<input {{startDebugStatus}} onclick="confirmComponentAction('{{encodedTopologyId}}', '{{encodedId}}', '{{componentName}}', 'debug/enable', true, {{currentSamplingPct}}, 'sampling percentage', 'debug')" type="button" value="Debug" class="btn btn-default">
{{#loggersDisabled}}
</span>
{{/loggersDisabled}}
<input {{stopDebugStatus}} onclick="confirmComponentAction('{{encodedTopologyId}}', '{{encodedId}}', '{{componentName}}', 'debug/disable', false, 0, 'sampling percentage', 'stop debugging')" type="button" value="Stop Debug" class="btn btn-default">
</p>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ <h2>Topology actions</h2>
<input {{deactivateStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'deactivate', false)" type="button" value="Deactivate" class="btn btn-default">
<input {{rebalanceStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'rebalance', true, {{msgTimeout}}, 'wait time in seconds')" type="button" value="Rebalance" class="btn btn-default">
<input {{killStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'kill', true, 30, 'wait time in seconds')" type="button" value="Kill" class="btn btn-default">
<input {{startDebugStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'debug/enable', true, {{currentSamplingPct}}, 'sampling percentage', 'debug')" type="button" value="Debug" class="btn btn-default">
{{#loggersDisabled}}
<span style="display:inline-block;" data-toggle="tooltip" title="" data-original-title="To debug, set topology.eventlogger.executors to a value > 0">
{{/loggersDisabled}}
<input {{startDebugStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'debug/enable', true, {{currentSamplingPct}}, 'sampling percentage', 'debug')" type="button" value="Debug" class="btn btn-default" >
{{#loggersDisabled}}
</span>
{{/loggersDisabled}}
<input {{stopDebugStatus}} onclick="confirmAction('{{encodedId}}', '{{name}}', 'debug/disable', false, 0, 'sampling percentage', 'stop debugging')" type="button" value="Stop Debug" class="btn btn-default">
<input type="button" {{logLevel}} value="Change Log Level" onclick="toggleChangeLogLevel()" class="btn btn-default">
</p>
Expand Down
2 changes: 1 addition & 1 deletion storm-core/src/ui/public/topology.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h2 id="topology-resources-header">Topology resources</h2>
var searchForm = $("#search-form")
var formattedConfig = formatConfigData(response["configuration"]);
var buttonJsonData = topologyActionJson(response["id"],response["encodedId"],response["name"],response["status"]
,response["msgTimeout"],response["debug"],response["samplingPct"]);
,response["msgTimeout"],response["configuration"]["topology.eventlogger.executors"],response["debug"],response["samplingPct"]);
$.ajax ({url: "/templates/topology-page-template.html", success: function(template) {
toggleChangeLogLevel = function (data) {
renderLogLevelForm (template, data);
Expand Down