From a33bc455db2c4cce0d355c9c0fa4da60471b859b Mon Sep 17 00:00:00 2001 From: Roshan Naik Date: Tue, 15 Mar 2016 21:26:12 -0700 Subject: [PATCH 1/3] STORM-1632) Disable event logging by default --- conf/defaults.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/defaults.yaml b/conf/defaults.yaml index 7128cfe9430..3f6a1c9e72e 100644 --- a/conf/defaults.yaml +++ b/conf/defaults.yaml @@ -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 From 3354cc7369a494ef9645df08d0803dedfb3d9192 Mon Sep 17 00:00:00 2001 From: Roshan Naik Date: Wed, 30 Mar 2016 16:30:43 -0700 Subject: [PATCH 2/3] Enable/disable Debug button on UI if eventloggers are enabled. Also show tooltip on Debug button --- storm-core/src/ui/public/js/script.js | 4 ++-- .../src/ui/public/templates/topology-page-template.html | 2 +- storm-core/src/ui/public/topology.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storm-core/src/ui/public/js/script.js b/storm-core/src/ui/public/js/script.js index a880205a710..c25195d43bf 100644 --- a/storm-core/src/ui/public/js/script.js +++ b/storm-core/src/ui/public/js/script.js @@ -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; @@ -220,7 +220,7 @@ 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"; jsonData["stopDebugStatus"] = (status === "ACTIVE" && debug) ? "enabled" : "disabled"; jsonData["currentSamplingPct"] = samplingPct; return jsonData; diff --git a/storm-core/src/ui/public/templates/topology-page-template.html b/storm-core/src/ui/public/templates/topology-page-template.html index 02b3c7693b1..a72effc18df 100644 --- a/storm-core/src/ui/public/templates/topology-page-template.html +++ b/storm-core/src/ui/public/templates/topology-page-template.html @@ -434,7 +434,7 @@

Topology actions

- +

diff --git a/storm-core/src/ui/public/topology.html b/storm-core/src/ui/public/topology.html index feb81f8f271..061fd918aac 100644 --- a/storm-core/src/ui/public/topology.html +++ b/storm-core/src/ui/public/topology.html @@ -285,7 +285,7 @@

Topology resources

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); From 7d7b3c2086a0172757af4bfc2a1a9dd9feee696c Mon Sep 17 00:00:00 2001 From: Roshan Naik Date: Thu, 31 Mar 2016 18:16:52 -0700 Subject: [PATCH 3/3] Showing tooltip on Debug button only when disabled and event loggers are disabled. Also enable/disable of Debug button along with toltip in component page --- storm-core/src/ui/public/component.html | 18 +++++++++++++++++- storm-core/src/ui/public/js/script.js | 6 ++++-- .../templates/component-page-template.html | 8 +++++++- .../templates/topology-page-template.html | 8 +++++++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/storm-core/src/ui/public/component.html b/storm-core/src/ui/public/component.html index 6d5465f17de..37ee525c92d 100644 --- a/storm-core/src/ui/public/component.html +++ b/storm-core/src/ui/public/component.html @@ -192,10 +192,26 @@

Storm UI

$('#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"); diff --git a/storm-core/src/ui/public/js/script.js b/storm-core/src/ui/public/js/script.js index c25195d43bf..ff3c5255548 100644 --- a/storm-core/src/ui/public/js/script.js +++ b/storm-core/src/ui/public/js/script.js @@ -222,17 +222,19 @@ function topologyActionJson(id, encodedId, name, status, msgTimeout, loggersTota jsonData["killStatus"] = (status !== "KILLED") ? "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; } -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; } 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 3626291309d..472a769bfbf 100644 --- a/storm-core/src/ui/public/templates/component-page-template.html +++ b/storm-core/src/ui/public/templates/component-page-template.html @@ -557,7 +557,13 @@

Errors

diff --git a/storm-core/src/ui/public/templates/topology-page-template.html b/storm-core/src/ui/public/templates/topology-page-template.html index a72effc18df..917831a9316 100644 --- a/storm-core/src/ui/public/templates/topology-page-template.html +++ b/storm-core/src/ui/public/templates/topology-page-template.html @@ -434,7 +434,13 @@

Topology actions

- + {{#loggersDisabled}} + + {{/loggersDisabled}} + + {{#loggersDisabled}} + + {{/loggersDisabled}}