File tree Expand file tree Collapse file tree
dd-trace-core/src/main/java/datadog/trace/common/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import java .util .Arrays ;
99import java .util .Collections ;
1010import java .util .List ;
11- import java .util .concurrent .atomic .AtomicLongArray ;
1211import 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.
You can’t perform that action at this time.
0 commit comments