Skip to content

Commit

Permalink
Show this little test that it has potential
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed Jun 9, 2022
1 parent ba61fd9 commit 6228773
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ public void ToOtlpResourceSpansTest(bool includeServiceNameInResource)
resourceBuilder.AddService("service-name", "ns1");
}

var exportedItems = new List<Activity>();
var builder = Sdk.CreateTracerProviderBuilder()
.SetResourceBuilder(resourceBuilder)
.AddSource(sources[0].Name)
.AddSource(sources[1].Name);
.AddSource(sources[1].Name)
.AddProcessor(new SimpleActivityExportProcessor(new InMemoryExporter<Activity>(exportedItems)));

using var openTelemetrySdk = builder.Build();

var exportedItems = new List<Activity>();
var processor = new BatchActivityExportProcessor(new InMemoryExporter<Activity>(exportedItems));
const int numOfSpans = 10;
bool isEven;
for (var i = 0; i < numOfSpans; i++)
Expand All @@ -161,8 +161,6 @@ public void ToOtlpResourceSpansTest(bool includeServiceNameInResource)
using Activity activity = source.StartActivity($"span-{i}", activityKind, parentContext: default, activityTags);
}

processor.Shutdown();

Assert.Equal(10, exportedItems.Count);
var batch = new Batch<Activity>(exportedItems.ToArray(), exportedItems.Count);
RunTest(batch);
Expand Down

0 comments on commit 6228773

Please sign in to comment.