From 0fae2afda0e4386f43b08c2bbd303678e968ee04 Mon Sep 17 00:00:00 2001 From: Jonathan Newbrough Date: Wed, 18 May 2016 12:33:16 -0700 Subject: [PATCH 1/2] avoid audo-enable of all probes due to jmx name default --- gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java | 8 ++++++-- .../src/main/java/com/dell/gumshoe/io/IOProbe.java | 2 +- .../com/dell/gumshoe/network/UnclosedSocketProbe.java | 2 +- .../main/java/com/dell/gumshoe/thread/ProcessorProbe.java | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java b/gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java index a1765e6..53aa012 100644 --- a/gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java +++ b/gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java @@ -67,9 +67,13 @@ protected static String[] getList(Properties p, String key) { return out; } + protected static String getMBeanName(Configuration p) { + return p.getProperty("mean.name"); + } + protected static String getMBeanName(Configuration p, Class clazz) { - final String packageName = clazz==null ? null : clazz.getPackage().getName(); - final String className = clazz==null ? null : clazz.getSimpleName(); + final String packageName = clazz.getPackage().getName(); + final String className = clazz.getSimpleName(); return p.getProperty("mbean.name", packageName + ":type=" + className); } diff --git a/gumshoe-probes/src/main/java/com/dell/gumshoe/io/IOProbe.java b/gumshoe-probes/src/main/java/com/dell/gumshoe/io/IOProbe.java index 580df48..0d139eb 100644 --- a/gumshoe-probes/src/main/java/com/dell/gumshoe/io/IOProbe.java +++ b/gumshoe-probes/src/main/java/com/dell/gumshoe/io/IOProbe.java @@ -44,7 +44,7 @@ public void initialize(Configuration cfg) throws Exception { // jmx enabled if explicit name, explicit property, or some reporting enabled final boolean jmxEnabled = - getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled); + getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled); final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null; final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled); diff --git a/gumshoe-probes/src/main/java/com/dell/gumshoe/network/UnclosedSocketProbe.java b/gumshoe-probes/src/main/java/com/dell/gumshoe/network/UnclosedSocketProbe.java index 69869ba..135b49d 100644 --- a/gumshoe-probes/src/main/java/com/dell/gumshoe/network/UnclosedSocketProbe.java +++ b/gumshoe-probes/src/main/java/com/dell/gumshoe/network/UnclosedSocketProbe.java @@ -34,7 +34,7 @@ public void initialize(Configuration cfg) throws Exception { // jmx enabled if explicit name, explicit property, or some reporting enabled final boolean jmxEnabled = - getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled); + getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled); final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null; final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled); diff --git a/gumshoe-probes/src/main/java/com/dell/gumshoe/thread/ProcessorProbe.java b/gumshoe-probes/src/main/java/com/dell/gumshoe/thread/ProcessorProbe.java index b2dd566..65c6a56 100644 --- a/gumshoe-probes/src/main/java/com/dell/gumshoe/thread/ProcessorProbe.java +++ b/gumshoe-probes/src/main/java/com/dell/gumshoe/thread/ProcessorProbe.java @@ -36,7 +36,7 @@ public void initialize(Configuration cfg) throws Exception { // jmx enabled if explicit name, explicit property, or some reporting enabled final boolean jmxEnabled = - getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled); + getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled); final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null; final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled); From cf996808010d93ae5fc553f33f7e7af1d29db094 Mon Sep 17 00:00:00 2001 From: Jonathan Newbrough Date: Tue, 31 May 2016 10:00:30 -0700 Subject: [PATCH 2/2] fix title field order --- .../com/dell/gumshoe/inspector/tools/ReportFileChooser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gumshoe-tools/src/main/java/com/dell/gumshoe/inspector/tools/ReportFileChooser.java b/gumshoe-tools/src/main/java/com/dell/gumshoe/inspector/tools/ReportFileChooser.java index e4338b5..a07ae8c 100644 --- a/gumshoe-tools/src/main/java/com/dell/gumshoe/inspector/tools/ReportFileChooser.java +++ b/gumshoe-tools/src/main/java/com/dell/gumshoe/inspector/tools/ReportFileChooser.java @@ -127,7 +127,7 @@ public void done() { if(report!=null) { final Date time = parser.getReportTime(); final String reportTime = hms.format(time); - relayStats(parser.getFilename(), parser.getReportType(), reportTime, report); + relayStats(parser.getFilename(), reportTime, parser.getReportType(), report); } } catch(Exception ex) { notifyError("Parse error reading file");