Skip to content

Commit

Permalink
feat: warn via logging if the cache size is unusual low.
Browse files Browse the repository at this point in the history
This is useful for deployment, but also to see in benchmarks if the parameter has been set properly.
  • Loading branch information
Pfeil committed Jan 21, 2025
1 parent 698392e commit c1fdc5d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

import lombok.Getter;
import lombok.Setter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -50,6 +52,7 @@
@Configuration
@Validated
public class ApplicationProperties extends GenericApplicationProperties {
private static final Logger LOG = LoggerFactory.getLogger(ApplicationProperties.class);

/**
* Internal default set of types which indicate that, when used as a key
Expand Down Expand Up @@ -189,7 +192,10 @@ public void setValidationStrategy(ValidationStrategy strategy) {
}

public int getCacheMaxEntries() {
return cacheMaxEntries;
if (this.cacheMaxEntries <= 10) {
LOG.warn("Cache max entries is set to {} (low value)", this.cacheMaxEntries);
}
return this.cacheMaxEntries;
}

public void setCacheMaxEntries(int cacheMaxEntries) {
Expand Down

0 comments on commit c1fdc5d

Please sign in to comment.