jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1859442 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java xdocs/changes.xml
Date Fri, 17 May 2019 17:00:32 GMT
Author: fschumacher
Date: Fri May 17 17:00:32 2019
New Revision: 1859442

URL: http://svn.apache.org/viewvc?rev=1859442&view=rev
Log:
Reduce scanning for LogParser implementations in AccessLogSamplerBeanInfo.

I am not sure, that it fixes 63442, but it seems nonsense to re-scan all classes
over and over again. The classpath doesn't change that often.

Bugzilla 63442

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java?rev=1859442&r1=1859441&r2=1859442&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
Fri May 17 17:00:32 2019
@@ -24,6 +24,7 @@ package org.apache.jmeter.protocol.http.
 
 import java.beans.PropertyDescriptor;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.jmeter.protocol.http.util.accesslog.Filter;
@@ -37,6 +38,16 @@ import org.slf4j.LoggerFactory;
 
 public class AccessLogSamplerBeanInfo extends BeanInfoSupport {
     private static final Logger log = LoggerFactory.getLogger(AccessLogSamplerBeanInfo.class);
+    private static final List<String> LOG_PARSER_CLASSES = logParsers();
+
+    private static List<String> logParsers() {
+        try {
+            return ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[]
{ LogParser.class });
+        } catch (IOException e) {
+            log.warn("Could not find log parsers.", e);
+            return Collections.emptyList();
+        }
+    }
 
     public AccessLogSamplerBeanInfo() {
         super(AccessLogSampler.class);
@@ -58,9 +69,9 @@ public class AccessLogSamplerBeanInfo ex
             p.setValue(DEFAULT, AccessLogSampler.DEFAULT_CLASS);
             p.setValue(NOT_OTHER, Boolean.TRUE);
             p.setValue(NOT_EXPRESSION, Boolean.TRUE);
-            final List<String> logParserClasses = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(),
new Class[] { LogParser.class });
-            log.debug("found parsers: {}", logParserClasses);
-            p.setValue(TAGS, logParserClasses.toArray(new String[logParserClasses.size()]));
+            
+            log.debug("found parsers: {}", LOG_PARSER_CLASSES);
+            p.setValue(TAGS, LOG_PARSER_CLASSES.toArray(new String[LOG_PARSER_CLASSES.size()]));
 
             p = property("filterClassName"); // $NON-NLS-1$
             p.setValue(NOT_UNDEFINED, Boolean.FALSE);

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1859442&r1=1859441&r2=1859442&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri May 17 17:00:32 2019
@@ -137,6 +137,7 @@ to view the last major behaviors with th
 
 <h3>Other Samplers</h3>
 <ul>
+    <li><bug>63442</bug>Reduce scanning for <code>LogParser</code>
implementations in AccessLogSamplerBeanInfo.</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message