@@ -21,8 +21,8 @@ public abstract class AbstractAsyncStackProcessor implements StackProcessor {
2121 private static final String JCA_PROCESSOR_THREAD = "jca-processor-thread" ;
2222 private static final int CAPACITY = 100_000 ;
2323 private static final int DRAIN_BATCH_SIZE = 2048 ;
24- private static final long DEFAULT_STACK_HASH_RESET_INTERVAL_MILLIS = 300_000L ;
25- private static final long DEFAULT_STACK_HASH_RESET_INTERVAL_IN_DEDUP_MODE_MILLIS = 30_000L ;
24+ private static final long DEFAULT_DEDUP_RESET_INTERVAL_MILLIS = 300_000L ;
25+ private static final long DEFAULT_DEDUP_RESET_INTERVAL_IN_DEDUP_MODE_MILLIS = 30_000L ;
2626
2727 /**
2828 * counters
@@ -35,7 +35,7 @@ public abstract class AbstractAsyncStackProcessor implements StackProcessor {
3535 private final List <RecordingEvent > drainBuffer = new ArrayList <>(DRAIN_BATCH_SIZE );
3636 private final List <RecordingEvent > dedupBuffer = new ArrayList <>(DRAIN_BATCH_SIZE );
3737 private final Set <Integer > seenStackHashes = new HashSet <>();
38- private long nextStackHashResetAtMillis = 0L ;
38+ private long nextDedupResetAtMillis = 0L ;
3939 private boolean warnedMissingDedupResetInterval ;
4040
4141 /**
@@ -145,7 +145,7 @@ private Collection<RecordingEvent> drainNextBatch() {
145145 }
146146
147147 private Collection <RecordingEvent > filterReportableStacks (Collection <RecordingEvent > snapshot ) {
148- if (isReportAllStacks ()) {
148+ if (! isStackDeduplicationEnabled ()) {
149149 return snapshot ;
150150 }
151151
@@ -162,44 +162,44 @@ private Collection<RecordingEvent> filterReportableStacks(Collection<RecordingEv
162162
163163 private void maybeResetSeenStackHashes () {
164164 long now = currentTimeMillis ();
165- if (now < nextStackHashResetAtMillis ) {
165+ if (now < nextDedupResetAtMillis ) {
166166 return ;
167167 }
168168
169169 int clearedCount = seenStackHashes .size ();
170170 seenStackHashes .clear ();
171- nextStackHashResetAtMillis = now + getStackHashResetIntervalMillis ();
172- logger .info (String .format ("dedup cache purged: cleared %d stack hash(es), next reset in %dms" , clearedCount , getStackHashResetIntervalMillis ()));
171+ nextDedupResetAtMillis = now + getDedupResetIntervalMillis ();
172+ logger .info (String .format ("dedup cache purged: cleared %d stack hash(es), next reset in %dms" , clearedCount , getDedupResetIntervalMillis ()));
173173 }
174174
175175 private void resetDedupWindow () {
176176 seenStackHashes .clear ();
177- nextStackHashResetAtMillis = currentTimeMillis () + getStackHashResetIntervalMillis ();
177+ nextDedupResetAtMillis = currentTimeMillis () + getDedupResetIntervalMillis ();
178178 }
179179
180- protected boolean isReportAllStacks () {
181- return Config .get ().processor .reportAllStacks ;
180+ protected boolean isStackDeduplicationEnabled () {
181+ return Config .get ().processor .enableStackDeduplication ;
182182 }
183183
184- protected long getStackHashResetIntervalMillis () {
185- Long configuredInterval = getConfiguredStackHashResetIntervalMillis ();
184+ protected long getDedupResetIntervalMillis () {
185+ Long configuredInterval = getConfiguredDedupResetIntervalMillis ();
186186 if (configuredInterval != null ) {
187187 return Math .max (1_000L , configuredInterval );
188188 }
189189
190- if (! isReportAllStacks ()) {
190+ if (isStackDeduplicationEnabled ()) {
191191 if (!warnedMissingDedupResetInterval ) {
192- logger .warn ("processor.stackHashResetIntervalMillis is not set while processor.reportAllStacks=false . using default 30000ms" );
192+ logger .warn ("processor.dedupResetIntervalMillis is not set while processor.enableStackDeduplication=true . using default 30000ms" );
193193 warnedMissingDedupResetInterval = true ;
194194 }
195- return DEFAULT_STACK_HASH_RESET_INTERVAL_IN_DEDUP_MODE_MILLIS ;
195+ return DEFAULT_DEDUP_RESET_INTERVAL_IN_DEDUP_MODE_MILLIS ;
196196 }
197197
198- return DEFAULT_STACK_HASH_RESET_INTERVAL_MILLIS ;
198+ return DEFAULT_DEDUP_RESET_INTERVAL_MILLIS ;
199199 }
200200
201- protected Long getConfiguredStackHashResetIntervalMillis () {
202- return Config .get ().processor .stackHashResetIntervalMillis ;
201+ protected Long getConfiguredDedupResetIntervalMillis () {
202+ return Config .get ().processor .dedupResetIntervalMillis ;
203203 }
204204
205205 protected long currentTimeMillis () {
0 commit comments