Skip to content

Commit

Permalink
Rename to BatchExportActivityProcessorOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Aug 12, 2021
1 parent 188173d commit 7dfb935
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="BatchSpanExportProcessorOptions.cs" company="OpenTelemetry Authors">
// <copyright file="BatchExportActivityProcessorOptions.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -21,7 +21,7 @@

namespace OpenTelemetry.Trace
{
public class BatchSpanExportProcessorOptions : BatchExportProcessorOptions<Activity>
public class BatchExportActivityProcessorOptions : BatchExportProcessorOptions<Activity>
{
internal const string MaxQueueSizeEnvVarKey = "OTEL_BSP_MAX_QUEUE_SIZE";

Expand All @@ -31,7 +31,7 @@ public class BatchSpanExportProcessorOptions : BatchExportProcessorOptions<Activ

internal const string ScheduledDelayEnvVarKey = "OTEL_BSP_SCHEDULE_DELAY";

public BatchSpanExportProcessorOptions()
public BatchExportActivityProcessorOptions()
{
int value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="BatchSpanExportProcessorOptionsTest.cs" company="OpenTelemetry Authors">
// <copyright file="BatchExportActivityProcessorOptionsTest.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -19,9 +19,9 @@

namespace OpenTelemetry.Trace.Tests
{
public class BatchSpanExportProcessorOptionsTest : IDisposable
public class BatchExportActivityProcessorOptionsTest : IDisposable
{
public BatchSpanExportProcessorOptionsTest()
public BatchExportActivityProcessorOptionsTest()
{
this.ClearEnvVars();
}
Expand All @@ -34,7 +34,7 @@ public void Dispose()
[Fact]
public void BatchExportProcessorOptions_Defaults()
{
var options = new BatchSpanExportProcessorOptions();
var options = new BatchExportActivityProcessorOptions();

Assert.Equal(30000, options.ExporterTimeoutMilliseconds);
Assert.Equal(512, options.MaxExportBatchSize);
Expand All @@ -45,12 +45,12 @@ public void BatchExportProcessorOptions_Defaults()
[Fact]
public void BatchExportProcessorOptions_EnvironmentVariableOverride()
{
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ExporterTimeoutEnvVarKey, "1");
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.MaxExportBatchSizeEnvVarKey, "2");
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.MaxQueueSizeEnvVarKey, "3");
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ScheduledDelayEnvVarKey, "4");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey, "1");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxExportBatchSizeEnvVarKey, "2");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxQueueSizeEnvVarKey, "3");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ScheduledDelayEnvVarKey, "4");

var options = new BatchSpanExportProcessorOptions();
var options = new BatchExportActivityProcessorOptions();

Assert.Equal(1, options.ExporterTimeoutMilliseconds);
Assert.Equal(2, options.MaxExportBatchSize);
Expand All @@ -61,19 +61,19 @@ public void BatchExportProcessorOptions_EnvironmentVariableOverride()
[Fact]
public void BatchExportProcessorOptions_InvalidPortEnvironmentVariableOverride()
{
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ExporterTimeoutEnvVarKey, "invalid");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey, "invalid");

var options = new BatchSpanExportProcessorOptions();
var options = new BatchExportActivityProcessorOptions();

Assert.Equal(30000, options.ExporterTimeoutMilliseconds); // use default
}

[Fact]
public void BatchExportProcessorOptions_SetterOverridesEnvironmentVariable()
{
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ExporterTimeoutEnvVarKey, "123");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey, "123");

var options = new BatchSpanExportProcessorOptions
var options = new BatchExportActivityProcessorOptions
{
ExporterTimeoutMilliseconds = 89000,
};
Expand All @@ -84,18 +84,18 @@ public void BatchExportProcessorOptions_SetterOverridesEnvironmentVariable()
[Fact]
public void BatchExportProcessorOptions_EnvironmentVariableNames()
{
Assert.Equal("OTEL_BSP_EXPORT_TIMEOUT", BatchSpanExportProcessorOptions.ExporterTimeoutEnvVarKey);
Assert.Equal("OTEL_BSP_MAX_EXPORT_BATCH_SIZE", BatchSpanExportProcessorOptions.MaxExportBatchSizeEnvVarKey);
Assert.Equal("OTEL_BSP_MAX_QUEUE_SIZE", BatchSpanExportProcessorOptions.MaxQueueSizeEnvVarKey);
Assert.Equal("OTEL_BSP_SCHEDULE_DELAY", BatchSpanExportProcessorOptions.ScheduledDelayEnvVarKey);
Assert.Equal("OTEL_BSP_EXPORT_TIMEOUT", BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey);
Assert.Equal("OTEL_BSP_MAX_EXPORT_BATCH_SIZE", BatchExportActivityProcessorOptions.MaxExportBatchSizeEnvVarKey);
Assert.Equal("OTEL_BSP_MAX_QUEUE_SIZE", BatchExportActivityProcessorOptions.MaxQueueSizeEnvVarKey);
Assert.Equal("OTEL_BSP_SCHEDULE_DELAY", BatchExportActivityProcessorOptions.ScheduledDelayEnvVarKey);
}

private void ClearEnvVars()
{
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ExporterTimeoutEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.MaxExportBatchSizeEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.MaxQueueSizeEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchSpanExportProcessorOptions.ScheduledDelayEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxExportBatchSizeEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxQueueSizeEnvVarKey, null);
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ScheduledDelayEnvVarKey, null);
}
}
}

0 comments on commit 7dfb935

Please sign in to comment.