Skip to content

Commit

Permalink
W-15531319: Add CacheStatsReporter create logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzxu-crm committed Jun 20, 2024
1 parent 5dbd1f4 commit 2fc78ce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public CacheStatsReporter( MetricRegistry metricRegistry, String name, long maxS
this.cache = cache;
this.statsSnapshot = cache != null ? cache.stats() : null;

log.info("Create CacheStatsReporter {} with max size {} with cache object {}", name, maxSize, cache);

register( "maxSize", ( ) -> this.maxSize );
register( "size", () -> cache != null ? this.cache.size() : 0);
if( statsSnapshot != null )
Expand Down Expand Up @@ -84,6 +86,6 @@ public void dumpStats()

public void close()
{
metricNames.forEach( m -> metricRegistry.remove(m));
metricNames.forEach(metricRegistry::remove);
}
}

0 comments on commit 2fc78ce

Please sign in to comment.