Revert "Added a test using TraceIdRatioBasedSampler + ActivityTraceId.CreateRandom(). (#1994)" (#2002)

This reverts commit 39c0e0cd48.
This commit is contained in:
Cijo Thomas 2021-04-20 12:40:28 -07:00 committed by GitHub
parent 0f11cd206f
commit f67131937c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 26 deletions

View File

@ -96,32 +96,6 @@ namespace OpenTelemetry.Trace.Tests
defaultProbability.ShouldSample(new SamplingParameters(default, sampledtraceId, ActivityDisplayName, ActivityKindServer, null, null)).Decision);
}
[Theory]
[InlineData(1, 100, 100)]
[InlineData(0, 100, 0)]
[InlineData(0.5D, 100, 40, 60)]
public void SampleUsingRandomTraceIds(double probability, int numberOfSpans, int expectedNumberOfSampledSpansLowerInclusive, int? expectedNumberOfSampledSpansUpperInclusive = null)
{
Sampler probabilitySampler = new TraceIdRatioBasedSampler(probability);
int numberOfSampledSpans = 0;
for (int i = 0; i < numberOfSpans; i++)
{
ActivityTraceId traceId = ActivityTraceId.CreateRandom();
SamplingResult samplingResult = probabilitySampler.ShouldSample(new SamplingParameters(default, traceId, "Test", ActivityKind.Server));
if (samplingResult.Decision == SamplingDecision.RecordAndSample)
{
numberOfSampledSpans++;
}
}
Assert.True(numberOfSampledSpans >= expectedNumberOfSampledSpansLowerInclusive);
Assert.True(numberOfSampledSpans <= (expectedNumberOfSampledSpansUpperInclusive ?? expectedNumberOfSampledSpansLowerInclusive));
}
[Fact]
public void GetDescription()
{