Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed May 30, 2024
1 parent 1606bc7 commit c0b4645
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static class SamplingPreview {
// future goal: make parentBased sampling the default if item count is received via tracestate
public boolean parentBased;

public boolean suppressIngestionSampling;
public boolean ingestionSamplingEnabled = true;

@Deprecated public List<SamplingOverride> overrides = new ArrayList<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AiSampler implements Sampler {

private static final double SAMPLE_RATE_TO_DISABLE_INGESTION_SAMPLING = 99.99;

private final boolean suppressIngestionSampling;
private final boolean ingestionSamplingEnabled;
private final boolean localParentBased;
private final SamplingPercentage requestSamplingPercentage;
// when localParentBased=false, then this applies to all dependencies, not only parentless
Expand All @@ -39,22 +39,22 @@ public class AiSampler implements Sampler {
public AiSampler(
SamplingPercentage requestSamplingPercentage,
SamplingPercentage parentlessDependencySamplingPercentage,
boolean suppressIngestionSampling) {
boolean ingestionSamplingEnabled) {
this(
requestSamplingPercentage,
parentlessDependencySamplingPercentage,
suppressIngestionSampling,
ingestionSamplingEnabled,
true);
}

public AiSampler(
SamplingPercentage requestSamplingPercentage,
SamplingPercentage parentlessDependencySamplingPercentage,
boolean suppressIngestionSampling,
boolean ingestionSamplingEnabled,
boolean localParentBased) {
this.requestSamplingPercentage = requestSamplingPercentage;
this.parentlessDependencySamplingPercentage = parentlessDependencySamplingPercentage;
this.suppressIngestionSampling = suppressIngestionSampling;
this.ingestionSamplingEnabled = ingestionSamplingEnabled;
this.localParentBased = localParentBased;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public SamplingResult shouldSample(
return SamplingResult.drop();
}

if (sp == 100 && !suppressIngestionSampling) {
if (sp == 100 && ingestionSamplingEnabled) {
return SamplingResult.recordAndSample();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public static Sampler getSampler(
new AiSampler(
requestSamplingPercentage,
parentlessDependencySamplingPercentage,
samplingPreview.suppressIngestionSampling);
samplingPreview.ingestionSamplingEnabled);
} else if (sampling.percentage != null) {
SamplingPercentage samplingPercentage = SamplingPercentage.fixed(sampling.percentage);
sampler =
new AiSampler(
samplingPercentage, samplingPercentage, samplingPreview.suppressIngestionSampling);
samplingPercentage, samplingPercentage, samplingPreview.ingestionSamplingEnabled);
} else {
throw new AssertionError("ConfigurationBuilder should have set the default sampling");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

@UseAgent("applicationinsights-no-ingestion-sampling.json")
abstract class NoIngestionSamplingTest {
@UseAgent("applicationinsights-ingestion-sampling-disabled.json")
abstract class IngestionSamplingDisabledTest {

@RegisterExtension static final SmokeTestExtension testing = SmokeTestExtension.create();

Expand Down Expand Up @@ -62,29 +62,29 @@ void testNoIngestionSampling() throws Exception {
}

@Environment(TOMCAT_8_JAVA_8)
static class Tomcat8Java8Test extends NoIngestionSamplingTest {}
static class Tomcat8Java8Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_8_OPENJ9)
static class Tomcat8Java8OpenJ9Test extends NoIngestionSamplingTest {}
static class Tomcat8Java8OpenJ9Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_11)
static class Tomcat8Java11Test extends NoIngestionSamplingTest {}
static class Tomcat8Java11Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_11_OPENJ9)
static class Tomcat8Java11OpenJ9Test extends NoIngestionSamplingTest {}
static class Tomcat8Java11OpenJ9Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_17)
static class Tomcat8Java17Test extends NoIngestionSamplingTest {}
static class Tomcat8Java17Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_21)
static class Tomcat8Java21Test extends NoIngestionSamplingTest {}
static class Tomcat8Java21Test extends IngestionSamplingDisabledTest {}

@Environment(TOMCAT_8_JAVA_21_OPENJ9)
static class Tomcat8Java21OpenJ9Test extends NoIngestionSamplingTest {}
static class Tomcat8Java21OpenJ9Test extends IngestionSamplingDisabledTest {}

@Environment(WILDFLY_13_JAVA_8)
static class Wildfly13Java8Test extends NoIngestionSamplingTest {}
static class Wildfly13Java8Test extends IngestionSamplingDisabledTest {}

@Environment(WILDFLY_13_JAVA_8_OPENJ9)
static class Wildfly13Java8OpenJ9Test extends NoIngestionSamplingTest {}
static class Wildfly13Java8OpenJ9Test extends IngestionSamplingDisabledTest {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"preview": {
"sampling": {
"suppressIngestionSampling": true
"ingestionSamplingEnabled": false
}
}
}

0 comments on commit c0b4645

Please sign in to comment.