From 59dcecfabb8092e27f3369a89d5abebd92874ac2 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Mon, 1 Aug 2022 17:51:33 -0700 Subject: [PATCH] [Instrumentation.Runtime] Rename `RuntimeInstrumentOptions` to `RuntimeInstrumentationOptions` (#556) * Rename options object for Runtime Instrumentation --- .../CHANGELOG.md | 3 +++ .../MeterProviderBuilderExtensions.cs | 4 ++-- ...ons.cs => RuntimeInstrumentationOptions.cs} | 4 ++-- .../RuntimeMetrics.cs | 2 +- ...s => RuntimeInstrumentationOptionsTests.cs} | 18 ++++++++---------- 5 files changed, 16 insertions(+), 15 deletions(-) rename src/OpenTelemetry.Instrumentation.Runtime/{RuntimeInstrumentOptions.cs => RuntimeInstrumentationOptions.cs} (96%) rename test/OpenTelemetry.Instrumentation.Runtime.Tests/{RuntimeInstrumentOptionsTests.cs => RuntimeInstrumentationOptionsTests.cs} (83%) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md index 93c98d5ae5..878f819c97 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Rename `RuntimeInstrumentOptions` to `RuntimeInstrumentationOptions` + ([#556](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/556)) + ## 1.0.0-rc.3 Released 2022-Jul-25 diff --git a/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs index f207bb5bc6..9963243e7a 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/MeterProviderBuilderExtensions.cs @@ -33,11 +33,11 @@ public static class MeterProviderBuilderExtensions /// The instance of to chain the calls. public static MeterProviderBuilder AddRuntimeInstrumentation( this MeterProviderBuilder builder, - Action configure = null) + Action configure = null) { Guard.ThrowIfNull(builder); - var options = new RuntimeInstrumentOptions(); + var options = new RuntimeInstrumentationOptions(); configure?.Invoke(options); var instrumentation = new RuntimeMetrics(options); diff --git a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs similarity index 96% rename from src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs rename to src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs index 38455545f0..3809444a4a 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentOptions.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeInstrumentationOptions.cs @@ -1,4 +1,4 @@ -// +// // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,7 @@ namespace OpenTelemetry.Instrumentation.Runtime /// /// Options to define the runtime metrics. /// - public class RuntimeInstrumentOptions + public class RuntimeInstrumentationOptions { /* /// diff --git a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs index 77be030ee7..0b046b7ebe 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs @@ -219,7 +219,7 @@ static RuntimeMetrics() /// Initializes a new instance of the class. /// /// The options to define the metrics. - public RuntimeMetrics(RuntimeInstrumentOptions options) + public RuntimeMetrics(RuntimeInstrumentationOptions options) { } diff --git a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs similarity index 83% rename from test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs rename to test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs index 1f83d3ef30..d419f0c921 100644 --- a/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentOptionsTests.cs +++ b/test/OpenTelemetry.Instrumentation.Runtime.Tests/RuntimeInstrumentationOptionsTests.cs @@ -1,4 +1,4 @@ -// +// // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,17 +14,15 @@ // limitations under the License. // -using Xunit; - namespace OpenTelemetry.Instrumentation.Runtime.Tests { - public class RuntimeInstrumentOptionsTests + public class RuntimeInstrumentationOptionsTests { /* [Fact] public void Enable_All_If_Nothing_Was_Defined() { - var options = new RuntimeInstrumentOptions(); + var options = new RuntimeInstrumentationOptions(); Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -40,7 +38,7 @@ public void Enable_All_If_Nothing_Was_Defined() [Fact] public void Enable_Gc_Only() { - var options = new RuntimeInstrumentOptions { GcEnabled = true }; + var options = new RuntimeInstrumentationOptions { GcEnabled = true }; Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -57,7 +55,7 @@ public void Enable_Gc_Only() [Fact] public void Enable_Jit_Only() { - var options = new RuntimeInstrumentOptions { JitEnabled = true }; + var options = new RuntimeInstrumentationOptions { JitEnabled = true }; Assert.False(options.IsGcEnabled); Assert.True(options.IsJitEnabled); @@ -71,7 +69,7 @@ public void Enable_Jit_Only() [Fact] public void Enable_Threading_Only() { - var options = new RuntimeInstrumentOptions { ThreadingEnabled = true }; + var options = new RuntimeInstrumentationOptions { ThreadingEnabled = true }; Assert.False(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -86,7 +84,7 @@ public void Enable_Threading_Only() [Fact] public void Enable_Assemblies_Only() { - var options = new RuntimeInstrumentOptions { AssembliesEnabled = true }; + var options = new RuntimeInstrumentationOptions { AssembliesEnabled = true }; Assert.False(options.IsGcEnabled); #if NET6_0_OR_GREATER @@ -102,7 +100,7 @@ public void Enable_Assemblies_Only() [Fact] public void Enable_Multiple() { - var options = new RuntimeInstrumentOptions { GcEnabled = true, AssembliesEnabled = true }; + var options = new RuntimeInstrumentationOptions { GcEnabled = true, AssembliesEnabled = true }; Assert.True(options.IsGcEnabled); #if NET6_0_OR_GREATER