jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: svn commit: r1803103 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Date Mon, 31 Jul 2017 09:58:36 GMT


Am 30. Juli 2017 21:55:57 MESZ schrieb sebb <sebbaz@gmail.com>:
>On 26 July 2017 at 20:56,  <fschumacher@apache.org> wrote:
>> Author: fschumacher
>> Date: Wed Jul 26 19:56:08 2017
>> New Revision: 1803103
>>
>> URL: http://svn.apache.org/viewvc?rev=1803103&view=rev
>> Log:
>> Guard debug log messages that call a function with
>Logger#isDebugEnabled
>>
>> Bugzilla Id: 61176
>>
>> Modified:
>>    
>jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
>>
>> Modified:
>jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
>> URL:
>http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1803103&r1=1803102&r2=1803103&view=diff
>>
>==============================================================================
>> ---
>jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
>(original)
>> +++
>jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
>Wed Jul 26 19:56:08 2017
>> @@ -498,8 +498,10 @@ public class CacheManager extends Config
>>
>>      private CacheEntry getEntry(String url, Header[] headers) {
>>          CacheEntry entry = getCache().get(url);
>
>Fetch the cache separately here - see below.
>
>> -        log.debug("Cache: {}", getCache());
>> -        log.debug("inCache {} {} {}", url, entry, headers);
>> +        if (log.isDebugEnabled()) {
>> +            log.debug("Cache: {}", getCache());
>
>In this case, it would be better to fetch the cache once and store in
>a local variable.

Right. I was probably not thinking clearly enough in that moment. My intention was to not
log the cache at all.

Felix

>
>> +            log.debug("inCache {} {} {}", url, entry, headers);
>> +        }
>>          if (entry == null) {
>>              log.debug("No entry found for url {}", url);
>>              return null;
>> @@ -509,12 +511,16 @@ public class CacheManager extends Config
>>              return entry;
>>          }
>>          if (headers == null) {
>> -            log.debug("Entry {} found, but it should depend on vary
>{} for url {}", entry, entry.getVaryHeader(), url);
>> +            if (log.isDebugEnabled()) {
>> +                log.debug("Entry {} found, but it should depend on
>vary {} for url {}", entry, entry.getVaryHeader(), url);
>> +            }
>>              return null;
>>          }
>>          Pair<String, String> varyPair =
>getVaryHeader(entry.getVaryHeader(), headers);
>>          if (varyPair != null) {
>> -            log.debug("Looking again for {} because of {} with vary:
>{} ({})", url, entry, entry.getVaryHeader(), varyPair);
>> +            if (log.isDebugEnabled()) {
>> +                log.debug("Looking again for {} because of {} with
>vary: {} ({})", url, entry, entry.getVaryHeader(), varyPair);
>> +            }
>>              return getEntry(varyUrl(url, entry.getVaryHeader(),
>varyPair.getRight()), null);
>>          }
>>          return null;
>>
>>

Mime
View raw message