Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public List<DDSpan> firstTrace() {
return get(0);
}

public int getTraceCount() {
return traceCount.get();
}

@SuppressFBWarnings("NN_NAKED_NOTIFY")
@Override
public void write(List<DDSpan> trace) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,11 @@ public String getSpanId(AgentSpan span) {
return "0";
}

// @VisibleForTesting
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be fine with package visible member variables, but I don't feel strongly either way.

TraceInterceptors getInterceptors() {
return interceptors;
}

@Override
public boolean addTraceInterceptor(final TraceInterceptor interceptor) {
TraceInterceptor conflictingInterceptor = interceptors.add(interceptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ static DDSpan create(
* @param timestampMicro if greater than zero, use this time instead of the current time
* @param context the context used for the span
*/
private DDSpan(
// @VisibleForTesting
DDSpan(
@Nonnull String instrumentationName,
final long timestampMicro,
@Nonnull DDSpanContext context,
Expand Down Expand Up @@ -680,6 +681,11 @@ public long getDurationNano() {
return durationNano;
}

// @VisibleForTesting
void setDurationNano(long duration) {
DURATION_NANO_UPDATER.set(this, duration);
}

@Override
public String getServiceName() {
return context.getServiceName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public PendingTrace create(@Nonnull DDTraceId traceId, ConfigSnapshot traceConfi
private static final AtomicLongFieldUpdater<PendingTrace> LAST_REFERENCED =
AtomicLongFieldUpdater.newUpdater(PendingTrace.class, "lastReferenced");

private PendingTrace(
// @VisibleForTesting
PendingTrace(
@Nonnull CoreTracer tracer,
@Nonnull DDTraceId traceId,
@Nonnull PendingTraceBuffer pendingTraceBuffer,
Expand Down Expand Up @@ -238,6 +239,26 @@ int getPendingReferenceCount() {
return pendingReferenceCount;
}

// @VisibleForTesting
PendingTraceBuffer getPendingTraceBuffer() {
return pendingTraceBuffer;
}

// @VisibleForTesting
DDTraceId getTraceId() {
return traceId;
}

// @VisibleForTesting
boolean isRootSpanWritten() {
return rootSpanWritten;
}

// @VisibleForTesting
int getIsEnqueued() {
return isEnqueued;
}

boolean empty() {
return 0 >= COMPLETED_SPAN_COUNT.get(this) + PENDING_REFERENCE_COUNT.get(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ public DelayingPendingTraceBuffer(
LongRunningTracesTracker getRunningTracesTracker() {
return runningTracesTracker;
}

// @VisibleForTesting
Thread getWorker() {
return worker;
}

// @VisibleForTesting
MessagePassingBlockingQueue<Element> getQueue() {
return queue;
}
}

static class DiscardingPendingTraceBuffer extends PendingTraceBuffer {
Expand Down
Loading
Loading