Skip to content
Merged
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 @@ -87,10 +87,6 @@ private static class Output {
this.parentContext = parentContext;
}

boolean getSampledFlag() {
return SamplingDecision.RECORD_AND_SAMPLE.equals(samplingResult.getDecision());
}

OptionalLong getThreshold() {
Span parentSpan = Span.fromContext(parentContext);
OtelTraceState otelTraceState =
Expand Down Expand Up @@ -163,7 +159,6 @@ void testMinThresholdWithoutParentRandomValue() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);
assertThat(output.getThreshold()).hasValue(0);
assertThat(output.getRandomValue()).isNotPresent();
assertThat(output.getSampledFlag()).isTrue();
}

@Test
Expand All @@ -181,7 +176,6 @@ void testMinThresholdWithParentRandomValue() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);
assertThat(output.getThreshold()).hasValue(0);
assertThat(output.getRandomValue()).hasValue(parentRandomValue);
assertThat(output.getSampledFlag()).isTrue();
}

@Test
Expand All @@ -194,9 +188,8 @@ void testMaxThreshold() {
Output output = sample(input, sampler);

assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.DROP);
assertThat(output.getThreshold()).isEmpty();
assertThat(output.getThreshold()).isNotPresent();
assertThat(output.getRandomValue()).isNotPresent();
assertThat(output.getSampledFlag()).isFalse();
}

@Test
Expand All @@ -216,7 +209,6 @@ void testParentBasedInConsistentMode() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);
assertThat(output.getThreshold()).hasValue(parentRandomValue);
assertThat(output.getRandomValue()).hasValue(parentRandomValue);
assertThat(output.getSampledFlag()).isTrue();
}

@Test
Expand All @@ -232,7 +224,6 @@ void testParentBasedInLegacyMode() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);
assertThat(output.getThreshold()).isNotPresent();
assertThat(output.getRandomValue()).isNotPresent();
assertThat(output.getSampledFlag()).isTrue();
}

@Test
Expand All @@ -248,7 +239,6 @@ void testHalfThresholdNotSampled() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.DROP);
assertThat(output.getThreshold()).isNotPresent();
assertThat(output.getRandomValue()).hasValue(0x7FFFFFFFFFFFFFL);
assertThat(output.getSampledFlag()).isFalse();
}

@Test
Expand All @@ -264,7 +254,6 @@ void testHalfThresholdSampled() {
assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);
assertThat(output.getThreshold()).hasValue(0x80000000000000L);
assertThat(output.getRandomValue()).hasValue(0x80000000000000L);
assertThat(output.getSampledFlag()).isTrue();
}

@Test
Expand All @@ -279,9 +268,7 @@ void testParentViolatingInvariant() {
Output output = sample(input, sampler);

assertThat(output.samplingResult.getDecision()).isEqualTo(SamplingDecision.RECORD_AND_SAMPLE);

assertThat(output.getThreshold()).hasValue(0x0L);
assertThat(output.getRandomValue()).hasValue(0x80000000000000L);
assertThat(output.getSampledFlag()).isTrue();
}
}
Loading