Skip to content

Commit

Permalink
FISH-7426 decrease level of timing-related logging in payara config
Browse files Browse the repository at this point in the history
FISH-7426 improve logger speed - field initialization, use supplier
  • Loading branch information
aubi committed Jun 5, 2023
1 parent d8ff30f commit 39fd53a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class PayaraConfig implements Config {
private static final String MP_CONFIG_EXPANSION_ENABLED_STRING = "mp.config.property.expressions.enabled";
private static final String MP_CONFIG_PROFILE_NAME_STRING = "mp.config.profile";

private static final Logger log = Logger.getLogger(PayaraConfig.class.getName());

private static final class CacheEntry {
final ConfigValueImpl value;
final long expires;
Expand Down Expand Up @@ -136,7 +138,8 @@ public long getCacheDurationSeconds() {
configuredCacheDurationSeconds = defaultCacheDurationMilliSeconds;
}
configuredCacheDurationSecondsExpires = currentTimeMillis + configuredCacheDurationSeconds;
Logger.getLogger(PayaraConfig.class.getName()).log(Level.SEVERE, "getCacheDurationSeconds took about {0} ms", currentTimeMillis() - currentTimeMillis);
long endTimeMillis = currentTimeMillis();
log.log(Level.FINER, () -> "getCacheDurationSeconds took about " + (endTimeMillis - currentTimeMillis) + " ms");
return configuredCacheDurationSeconds;
}
}
Expand Down

0 comments on commit 39fd53a

Please sign in to comment.