Skip to content

Commit 976d335

Browse files
dougqhclaude
andcommitted
Remove unused AggregateEntry.recordDurations
recordDurations had no callers in any source tree; drop it and its now-orphaned AtomicLongArray import. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4188b43 commit 976d335

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateEntry.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.util.Arrays;
99
import java.util.Collections;
1010
import java.util.List;
11-
import java.util.concurrent.atomic.AtomicLongArray;
1211
import javax.annotation.Nullable;
1312

1413
/**
@@ -321,36 +320,6 @@ AggregateEntry recordOneDuration(long tagAndDuration) {
321320
return this;
322321
}
323322

324-
/**
325-
* Records {@code count} durations from {@code durations} (positions 0..count-1). Used by
326-
* integration tests; production code uses {@link #recordOneDuration}.
327-
*/
328-
@SuppressFBWarnings(
329-
value = "AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE",
330-
justification =
331-
"Single-writer by design: recording counters are mutated only on the aggregator thread"
332-
+ " (see class javadoc); no cross-thread atomicity guarantee is needed.")
333-
AggregateEntry recordDurations(int count, AtomicLongArray durations) {
334-
this.hitCount += count;
335-
for (int i = 0; i < count && i < durations.length(); ++i) {
336-
long d = durations.getAndSet(i, 0);
337-
if ((d & TOP_LEVEL_TAG) == TOP_LEVEL_TAG) {
338-
d ^= TOP_LEVEL_TAG;
339-
topLevelCount++;
340-
}
341-
if ((d & ERROR_TAG) == ERROR_TAG) {
342-
d ^= ERROR_TAG;
343-
errorLatenciesForWrite().accept(d);
344-
this.errorDuration += d;
345-
errorCount++;
346-
} else {
347-
okLatencies.accept(d);
348-
this.okDuration += d;
349-
}
350-
}
351-
return this;
352-
}
353-
354323
/**
355324
* Clears the recording state. The OK histogram is reused; the error histogram (if allocated) is
356325
* reused too, but entries that never saw an error keep their {@code errorLatencies} field null.

0 commit comments

Comments
 (0)