Skip to content

Commit

Permalink
Start shuffling namespaces per API feedback (#4405)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
  • Loading branch information
geeknoid and Martin Taillefer authored Sep 14, 2023
1 parent 3d37cef commit ddd94dc
Show file tree
Hide file tree
Showing 250 changed files with 652 additions and 696 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Resilience.FaultInjection;
using Microsoft.Extensions.Telemetry.Metrics;

namespace Microsoft.Extensions.Http.Resilience.FaultInjection.PerformanceTests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
using Microsoft.Extensions.Compliance.Testing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Telemetry.Metrics;

#pragma warning disable EA0006 // Replace uses of 'Enum.GetName' and 'Enum.ToString' with the '[EnumStrings]' code generator for improved performance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Telemetry.Enrichment;
using Microsoft.Extensions.Telemetry.Logging;

namespace Microsoft.Extensions.Telemetry.Bench;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class ModernCodeGen
/// </summary>
public static void RefTypes(global::Microsoft.Extensions.Logging.ILogger logger, string connectionId, string type, string streamId, string length, string flags, string other)
{
var state = global::Microsoft.Extensions.Telemetry.Logging.LoggerMessageHelper.ThreadLocalState;
var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState;

_ = state.ReserveTagSpace(7);
state.TagArray[6] = new("connectionId", connectionId);
Expand Down Expand Up @@ -46,7 +46,7 @@ public static void RefTypes(global::Microsoft.Extensions.Logging.ILogger logger,
/// </summary>
public static void ValueTypes(global::Microsoft.Extensions.Logging.ILogger logger, long start, long end, int options, global::System.Guid guid)
{
var state = global::Microsoft.Extensions.Telemetry.Logging.LoggerMessageHelper.ThreadLocalState;
var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState;

_ = state.ReserveTagSpace(5);
state.TagArray[4] = new("start", start);
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Microsoft.Gen.Logging/Emission/Emitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Gen.Logging.Emission;

internal sealed partial class Emitter : EmitterBase
{
private const string LoggerMessageHelperType = "global::Microsoft.Extensions.Telemetry.Logging.LoggerMessageHelper";
private const string LoggerMessageHelperType = "global::Microsoft.Extensions.Logging.LoggerMessageHelper";

private readonly StringBuilderPool _sbPool = new();
private readonly Dictionary<string, string> _classificationMap = new();
Expand Down
8 changes: 4 additions & 4 deletions src/Generators/Microsoft.Gen.Logging/Parsing/SymbolLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace Microsoft.Gen.Logging.Parsing;
internal static class SymbolLoader
{
internal const string LoggerMessageAttribute = "Microsoft.Extensions.Logging.LoggerMessageAttribute";
internal const string LogPropertiesAttribute = "Microsoft.Extensions.Telemetry.Logging.LogPropertiesAttribute";
internal const string TagProviderAttribute = "Microsoft.Extensions.Telemetry.Logging.TagProviderAttribute";
internal const string LogPropertyIgnoreAttribute = "Microsoft.Extensions.Telemetry.Logging.LogPropertyIgnoreAttribute";
internal const string ITagCollectorType = "Microsoft.Extensions.Telemetry.Logging.ITagCollector";
internal const string LogPropertiesAttribute = "Microsoft.Extensions.Logging.LogPropertiesAttribute";
internal const string TagProviderAttribute = "Microsoft.Extensions.Logging.TagProviderAttribute";
internal const string LogPropertyIgnoreAttribute = "Microsoft.Extensions.Logging.LogPropertyIgnoreAttribute";
internal const string ITagCollectorType = "Microsoft.Extensions.Logging.ITagCollector";
internal const string ILoggerType = "Microsoft.Extensions.Logging.ILogger";
internal const string LogLevelType = "Microsoft.Extensions.Logging.LogLevel";
internal const string ExceptionType = "System.Exception";
Expand Down
12 changes: 6 additions & 6 deletions src/Generators/Microsoft.Gen.Metrics/SymbolLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace Microsoft.Gen.Metrics;

internal static class SymbolLoader
{
internal const string CounterTAttribute = "Microsoft.Extensions.Telemetry.Metrics.CounterAttribute`1";
internal const string HistogramTAttribute = "Microsoft.Extensions.Telemetry.Metrics.HistogramAttribute`1";
internal const string GaugeAttribute = "Microsoft.Extensions.Telemetry.Metrics.GaugeAttribute";
internal const string CounterAttribute = "Microsoft.Extensions.Telemetry.Metrics.CounterAttribute";
internal const string HistogramAttribute = "Microsoft.Extensions.Telemetry.Metrics.HistogramAttribute";
internal const string TagNameAttribute = "Microsoft.Extensions.Telemetry.Metrics.TagNameAttribute";
internal const string CounterTAttribute = "Microsoft.Extensions.Diagnostics.Metrics.CounterAttribute`1";
internal const string HistogramTAttribute = "Microsoft.Extensions.Diagnostics.Metrics.HistogramAttribute`1";
internal const string GaugeAttribute = "Microsoft.Extensions.Diagnostics.Metrics.GaugeAttribute";
internal const string CounterAttribute = "Microsoft.Extensions.Diagnostics.Metrics.CounterAttribute";
internal const string HistogramAttribute = "Microsoft.Extensions.Diagnostics.Metrics.HistogramAttribute";
internal const string TagNameAttribute = "Microsoft.Extensions.Diagnostics.Metrics.TagNameAttribute";
internal const string MeterClass = "System.Diagnostics.Metrics.Meter";

internal static SymbolHolder? LoadSymbols(Compilation compilation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.HeaderParsing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.HeaderParsing;
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/Microsoft.AspNetCore.HeaderParsing/Metric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.Metrics;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Extensions.Diagnostics.Metrics;

namespace Microsoft.AspNetCore.HeaderParsing;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Primitives;
using Microsoft.Extensions.Telemetry.Latency;

namespace Microsoft.AspNetCore.Telemetry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.AmbientMetadata;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Http.Telemetry;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Shared.Pools;

namespace Microsoft.AspNetCore.Telemetry.Internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Concurrent;
using Microsoft.Extensions.Telemetry.Logging;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Internal;
using Microsoft.Extensions.Telemetry.Logging;
using Microsoft.Shared.Diagnostics;
using Microsoft.Shared.Pools;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Telemetry.Internal;
using Microsoft.Extensions.Telemetry.Logging;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Telemetry.Logging;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Shared.DiagnosticIds;
using Microsoft.Shared.Diagnostics;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using System.Diagnostics.Metrics;
using System.Globalization;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.EnumStrings;
using Microsoft.Extensions.Telemetry.Metrics;

[assembly: EnumStrings(typeof(Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus))]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Shared.Diagnostics;
using Microsoft.Shared.Pools;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Metrics;

namespace Microsoft.Extensions.Diagnostics.ResourceMonitoring.Internal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Diagnostics.ResourceMonitoring.Internal;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Metrics;

namespace Microsoft.Extensions.Diagnostics.ResourceMonitoring;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Diagnostics.ResourceMonitoring.Internal;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Metrics;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.Diagnostics.ResourceMonitoring;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Testing.Internal;
using Microsoft.Extensions.Telemetry.Testing.Logging;
using Microsoft.Extensions.Logging.Testing;
using Microsoft.Shared.DiagnosticIds;
using Microsoft.Shared.Diagnostics;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Telemetry.Testing.Logging;
using Microsoft.Extensions.Logging.Testing;

namespace Microsoft.Extensions.Hosting.Testing.Internal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"Stage": "Experimental"
},
{
"Member": "static Microsoft.Extensions.Telemetry.Testing.Logging.FakeLogCollector Microsoft.Extensions.Hosting.Testing.HostingFakesExtensions.GetFakeLogCollector(this Microsoft.Extensions.Hosting.IHost host);",
"Member": "static Microsoft.Extensions.Logging.Testing.FakeLogCollector Microsoft.Extensions.Hosting.Testing.HostingFakesExtensions.GetFakeLogCollector(this Microsoft.Extensions.Hosting.IHost host);",
"Stage": "Experimental"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.EnumStrings;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Resilience.FaultInjection;
using Microsoft.Extensions.Telemetry.Metrics;
using Polly;
using Polly.Contrib.Simmy;
using Polly.Contrib.Simmy.Outcomes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Http.Resilience.FaultInjection.Internal;

internal static partial class Metric
{
[Microsoft.Extensions.Telemetry.Metrics.Counter(
[Microsoft.Extensions.Diagnostics.Metrics.Counter(
FaultInjectionEventMeterTagNames.FaultInjectionGroupName,
FaultInjectionEventMeterTagNames.FaultType,
FaultInjectionEventMeterTagNames.InjectedValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using System.Net.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Http.Telemetry.Latency.Internal;
using Microsoft.Extensions.Http.Telemetry.Logging;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.Http.Telemetry.Latency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Threading;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.Extensions.Http.Telemetry.Latency.Internal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Http.Telemetry.Logging;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Telemetry.Enrichment;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Shared.Pools;

namespace Microsoft.Extensions.Http.Telemetry.Latency.Internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.AmbientMetadata;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Telemetry.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.Extensions.Http.Telemetry.Latency.Internal;
Expand Down
Loading

0 comments on commit ddd94dc

Please sign in to comment.