Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -74,7 +74,7 @@ private static final class State {
private final double effectiveWindowNanos;
private final long lastNanoTime;

public State(double effectiveWindowCount, double effectiveWindowNanos, long lastNanoTime) {
State(double effectiveWindowCount, double effectiveWindowNanos, long lastNanoTime) {
this.effectiveWindowCount = effectiveWindowCount;
this.effectiveWindowNanos = effectiveWindowNanos;
this.lastNanoTime = lastNanoTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static final class ReadableSpanWithPriority {
private final int rval;
private final long priority;

public static ReadableSpanWithPriority create(
static ReadableSpanWithPriority create(
Copy link
Contributor

Choose a reason for hiding this comment

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

cool, removing unnecessary public modifier and reducing since it is only used internally.

ReadableSpan readableSpan, RandomGenerator randomGenerator) {
String otelTraceStateString =
readableSpan.getSpanContext().getTraceState().get(OtelTraceState.TRACE_STATE_KEY);
Expand Down Expand Up @@ -201,7 +201,7 @@ private static final class Reservoir {
private final PriorityQueue<ReadableSpanWithPriority> queue;
private final RandomGenerator randomGenerator;

public Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
if (reservoirSize < 1) {
throw new IllegalArgumentException();
}
Expand All @@ -211,7 +211,7 @@ public Reservoir(int reservoirSize, RandomGenerator randomGenerator) {
this.randomGenerator = randomGenerator;
}

public void add(ReadableSpanWithPriority readableSpanWithPriority) {
void add(ReadableSpanWithPriority readableSpanWithPriority) {

if (queue.size() < reservoirSize) {
queue.add(readableSpanWithPriority);
Expand All @@ -232,7 +232,7 @@ public void add(ReadableSpanWithPriority readableSpanWithPriority) {
}
}

public List<SpanData> getResult() {
List<SpanData> getResult() {

if (numberOfDiscardedSpansWithMaxDiscardedRValue == 0) {
return queue.stream().map(x -> x.readableSpan.toSpanData()).collect(Collectors.toList());
Expand Down Expand Up @@ -294,7 +294,7 @@ public List<SpanData> getResult() {
return result;
}

public boolean isEmpty() {
boolean isEmpty() {
return queue.isEmpty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static final class State {
private final double effectiveDelegateProbability;
private final long lastNanoTime;

public State(
State(
double effectiveWindowCount,
double effectiveWindowNanos,
long lastNanoTime,
Expand Down
4 changes: 2 additions & 2 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dependencies {
api("com.google.auto.service:auto-service-annotations:1.1.1")
api("com.google.auto.value:auto-value:1.11.0")
api("com.google.auto.value:auto-value-annotations:1.11.0")
api("com.google.errorprone:error_prone_annotations:2.40.0")
api("com.google.errorprone:error_prone_core:2.40.0")
api("com.google.errorprone:error_prone_annotations:2.41.0")
api("com.google.errorprone:error_prone_core:2.41.0")
api("io.github.netmikey.logunit:logunit-jul:2.0.0")
api("io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha")
api("io.prometheus:simpleclient:0.16.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ private static Attributes protoToAttributes(List<KeyValue> source) {
}

private static final class DataWithType {
public final Data<?> data;
public final MetricDataType type;
final Data<?> data;
final MetricDataType type;

private DataWithType(Data<?> data, MetricDataType type) {
this.data = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,27 @@ private static class PropertiesApplier {

private final ConfigProperties properties;

public PropertiesApplier(ConfigProperties properties) {
PropertiesApplier(ConfigProperties properties) {
this.properties = properties;
}

public void applyBool(String configKey, Consumer<Boolean> funcToApply) {
void applyBool(String configKey, Consumer<Boolean> funcToApply) {
applyValue(properties.getBoolean(configKey), funcToApply);
}

public void applyInt(String configKey, Consumer<Integer> funcToApply) {
void applyInt(String configKey, Consumer<Integer> funcToApply) {
applyValue(properties.getInt(configKey), funcToApply);
}

public void applyDuration(String configKey, Consumer<Duration> funcToApply) {
void applyDuration(String configKey, Consumer<Duration> funcToApply) {
applyValue(properties.getDuration(configKey), funcToApply);
}

public void applyString(String configKey, Consumer<String> funcToApply) {
void applyString(String configKey, Consumer<String> funcToApply) {
applyValue(properties.getString(configKey), funcToApply);
}

public void applyWildcards(
String configKey, Consumer<? super List<WildcardMatcher>> funcToApply) {
void applyWildcards(String configKey, Consumer<? super List<WildcardMatcher>> funcToApply) {
String wildcardListString = properties.getString(configKey);
if (wildcardListString != null && !wildcardListString.isEmpty()) {
List<WildcardMatcher> values =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ public int compareTo(StackTraceEvent o) {
}

private static class ActivationEvent {
public static final int SERIALIZED_SIZE =
static final int SERIALIZED_SIZE =
Long.SIZE / Byte.SIZE
+ // timestamp
TraceContext.SERIALIZED_LENGTH
Expand All @@ -826,7 +826,7 @@ private static class ActivationEvent {
private long threadId;
private boolean activation;

public void activation(
void activation(
Span context,
long threadId,
@Nullable Span previousContext,
Expand All @@ -835,7 +835,7 @@ public void activation(
set(context, threadId, /* activation= */ true, previousContext, nanoTime, clock);
}

public void deactivation(
void deactivation(
Span context,
long threadId,
@Nullable Span previousContext,
Expand Down Expand Up @@ -864,7 +864,7 @@ private void set(
this.timestamp = nanoTime;
}

public void handle(SamplingProfiler samplingProfiler) {
void handle(SamplingProfiler samplingProfiler) {
if (logger.isLoggable(Level.FINE)) {
logger.log(
Level.FINE,
Expand Down Expand Up @@ -975,7 +975,7 @@ private void stopProfiling(SamplingProfiler samplingProfiler) {
}
}

public void serialize(ByteBuffer buf) {
void serialize(ByteBuffer buf) {
buf.putLong(timestamp);
buf.put(traceContextBuffer);
buf.put(previousContextBuffer);
Expand All @@ -984,7 +984,7 @@ public void serialize(ByteBuffer buf) {
buf.put(activation ? (byte) 1 : (byte) 0);
}

public void deserialize(ByteBuffer buf) {
void deserialize(ByteBuffer buf) {
timestamp = buf.getLong();
buf.get(traceContextBuffer);
buf.get(previousContextBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static <T> Iterable<T> of(Runnable callback) {

private final Runnable callback;

public PollingIterable(Runnable callback) {
PollingIterable(Runnable callback) {
this.callback = callback;
}

Expand Down
Loading