From 3c35717eb9b68d026db9f2991c1de666253e8696 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 24 May 2023 12:00:52 +0000 Subject: [PATCH 1/2] Update dependencies from https://github.com/dotnet/runtime build 20230524.1 Microsoft.Bcl.AsyncInterfaces , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting From Version 8.0.0-preview.5.23273.1 -> To Version 8.0.0-preview.5.23274.1 --- eng/Version.Details.xml | 248 ++++++++++++++++++++-------------------- eng/Versions.props | 124 ++++++++++---------- 2 files changed, 186 insertions(+), 186 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5bf2d93ee5c3..d2bc4e47b03c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -41,259 +41,259 @@ https://github.com/dotnet/efcore d3362f65007769fd1c8ef442743832d91c7a34cb - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 https://github.com/dotnet/source-build-externals 21d564f9e16f7986d8af0692258afb91a52dda80 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 https://github.com/dotnet/xdt @@ -326,9 +326,9 @@ - + https://github.com/dotnet/runtime - 1e421670a6456d9c5b924b7ffea14cab8559a2e9 + 7a119156cbe958c5c34098434e84010526fac5f1 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 0bdde4945282..73f4c57ca800 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -63,69 +63,69 @@ --> - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 - 8.0.0-preview.5.23273.1 - 8.0.0-preview.5.23273.1 + 8.0.0-preview.5.23274.1 + 8.0.0-preview.5.23274.1 8.0.0-preview.6.23273.4 8.0.0-preview.6.23273.4 From cf6bbc90c5956e10d7f76964a449cdc0dcf6b88f Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 24 May 2023 18:33:50 -0500 Subject: [PATCH 2/2] Resolve Metrics conflicts as a temporary workaround to unblock the merge from runtime. --- .../Hosting/test/HostingMetricsTests.cs | 12 ++--- .../DeveloperExceptionPageMiddlewareTest.cs | 2 +- .../test/UnitTests/ExceptionHandlerTest.cs | 2 +- .../test/RateLimitingMetricsTests.cs | 50 +++++++++---------- .../localize/templatestrings.en.json | 4 +- .../ConnectionLimitTests.cs | 2 +- .../KestrelMetricsTests.cs | 42 ++++++++-------- src/Shared/Metrics/DefaultMeterFactory.cs | 4 +- src/Shared/Metrics/IMeterFactory.cs | 7 --- .../test/HttpConnectionDispatcherTests.cs | 6 +-- .../test/HttpConnectionManagerTests.cs | 8 +-- 11 files changed, 66 insertions(+), 73 deletions(-) diff --git a/src/Hosting/Hosting/test/HostingMetricsTests.cs b/src/Hosting/Hosting/test/HostingMetricsTests.cs index 72877540bce7..5d748fb82ef2 100644 --- a/src/Hosting/Hosting/test/HostingMetricsTests.cs +++ b/src/Hosting/Hosting/test/HostingMetricsTests.cs @@ -26,8 +26,8 @@ public void MultipleRequests() var httpContext = new DefaultHttpContext(); var meter = meterFactory.Meters.Single(); - using var requestDurationRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); - using var currentRequestsRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); + using var requestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); + using var currentRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); // Act/Assert Assert.Equal(HostingMetrics.MeterName, meter.Name); @@ -130,8 +130,8 @@ public async Task StartListeningDuringRequest_NotMeasured() await syncPoint.WaitForSyncPoint().DefaultTimeout(); - using var requestDurationRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); - using var currentRequestsRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); + using var requestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); + using var currentRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); context1.HttpContext.Response.StatusCode = StatusCodes.Status200OK; syncPoint.Continue(); @@ -153,8 +153,8 @@ public void IHttpMetricsTagsFeatureNotUsedFromFeatureCollection() var httpContext = new DefaultHttpContext(); var meter = meterFactory.Meters.Single(); - using var requestDurationRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); - using var currentRequestsRecorder = new InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); + using var requestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "request-duration"); + using var currentRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, HostingMetrics.MeterName, "current-requests"); // Act/Assert Assert.Equal(HostingMetrics.MeterName, meter.Name); diff --git a/src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs b/src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs index ba3f469038e0..cf3a7bc00c5b 100644 --- a/src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs +++ b/src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs @@ -541,7 +541,7 @@ public async Task UnhandledError_ExceptionNameTagAdded() var meterFactory = new TestMeterFactory(); var meterRegistry = new TestMeterRegistry(meterFactory.Meters); - var instrumentRecorder = new InstrumentRecorder(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration"); + var instrumentRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration"); instrumentRecorder.Register(m => { tcs.SetResult(); diff --git a/src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs b/src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs index 6b9cc6f9e42b..369ec7aa0c48 100644 --- a/src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs +++ b/src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs @@ -918,7 +918,7 @@ public async Task UnhandledError_ExceptionNameTagAdded() var meterFactory = new TestMeterFactory(); var meterRegistry = new TestMeterRegistry(meterFactory.Meters); - var instrumentRecorder = new InstrumentRecorder(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration"); + var instrumentRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration"); instrumentRecorder.Register(m => { tcs.SetResult(); diff --git a/src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs b/src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs index 9f5f7388daf9..2c150249f2c2 100644 --- a/src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs +++ b/src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs @@ -35,11 +35,11 @@ public async Task Metrics_Rejected() var context = new DefaultHttpContext(); - using var leaseRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); - using var currentLeaseRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); - using var currentRequestsQueuedRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); - using var queuedRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); - using var leaseFailedRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); + using var leaseRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); + using var currentLeaseRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); + using var currentRequestsQueuedRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); + using var queuedRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); + using var leaseFailedRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); // Act await middleware.Invoke(context).DefaultTimeout(); @@ -83,11 +83,11 @@ public async Task Metrics_Success() var context = new DefaultHttpContext(); context.Request.Method = "GET"; - using var leaseRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); - using var currentLeaseRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); - using var currentRequestsQueuedRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); - using var queuedRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); - using var leaseFailedRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); + using var leaseRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); + using var currentLeaseRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); + using var currentRequestsQueuedRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); + using var queuedRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); + using var leaseFailedRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); // Act var middlewareTask = middleware.Invoke(context); @@ -144,11 +144,11 @@ public async Task Metrics_ListenInMiddleOfRequest_CurrentLeasesNotDecreased() await syncPoint.WaitForSyncPoint().DefaultTimeout(); - using var leaseRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); - using var currentLeaseRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); - using var currentRequestsQueuedRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); - using var queuedRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); - using var leaseFailedRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); + using var leaseRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); + using var currentLeaseRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); + using var currentRequestsQueuedRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); + using var queuedRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); + using var leaseFailedRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); syncPoint.Continue(); @@ -196,11 +196,11 @@ public async Task Metrics_Queued() routeEndpointBuilder.Metadata.Add(new EnableRateLimitingAttribute("concurrencyPolicy")); var endpoint = routeEndpointBuilder.Build(); - using var leaseRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); - using var currentLeaseRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); - using var currentRequestsQueuedRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); - using var queuedRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); - using var leaseFailedRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); + using var leaseRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); + using var currentLeaseRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); + using var currentRequestsQueuedRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); + using var queuedRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); + using var leaseFailedRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); // Act var context1 = new DefaultHttpContext(); @@ -284,11 +284,11 @@ public async Task Metrics_ListenInMiddleOfQueued_CurrentQueueNotDecreased() // Start listening while the second request is queued. - using var leaseRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); - using var currentLeaseRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); - using var currentRequestsQueuedRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); - using var queuedRequestDurationRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); - using var leaseFailedRequestsRecorder = new InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); + using var leaseRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration"); + using var currentLeaseRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests"); + using var currentRequestsQueuedRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests"); + using var queuedRequestDurationRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration"); + using var leaseFailedRequestsRecorder = new Extensions.Metrics.InstrumentRecorder(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests"); Assert.Empty(currentRequestsQueuedRecorder.GetMeasurements()); Assert.Empty(queuedRequestDurationRecorder.GetMeasurements()); diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json index e3bc4df88b51..6458afa6727f 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Components-CSharp/.template.config/localize/templatestrings.en.json @@ -1,7 +1,7 @@ { "author": "Microsoft", "name": "Blazor Web App", - "description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).", + "description": "A project template for creating a Blazor web app that supports both server-side rendering and client interactivity. This template can be used for web apps with rich dynamic user interfaces (UIs).", "symbols/Framework/description": "The target framework for the project.", "symbols/Framework/choices/net8.0/description": "Target net8.0", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.", @@ -21,4 +21,4 @@ "symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.", "postActions/restore/description": "Restore NuGet packages required by this project.", "postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'" -} +} \ No newline at end of file diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs index 15393c8950e1..65de389945bb 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs @@ -102,7 +102,7 @@ public async Task UpgradedConnectionsCountsAgainstDifferentLimit() public async Task RejectsConnectionsWhenLimitReached() { var testMeterFactory = new TestMeterFactory(); - using var rejectedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "rejected-connections"); + using var rejectedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "rejected-connections"); const int max = 10; var requestTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs index c0e8349a3bbb..e7469ef3bc03 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs @@ -46,9 +46,9 @@ public async Task Http1Connection() }); var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var queuedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var queuedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)); @@ -122,9 +122,9 @@ public async Task Http1Connection_BeginListeningAfterConnectionStarted() // Wait for connection to start on the server. await sync.WaitForSyncPoint(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var queuedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var queuedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); // Signal that connection can continue. sync.Continue(); @@ -169,9 +169,9 @@ public async Task Http1Connection_IHttpConnectionTagsFeatureIgnoreFeatureSetOnTr }); var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var queuedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var queuedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)); @@ -244,9 +244,9 @@ public async Task Http1Connection_Error() }); var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var queuedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var queuedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)); @@ -287,9 +287,9 @@ public async Task Http1Connection_Upgrade() var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var currentUpgradedRequests = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-upgraded-connections"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var currentUpgradedRequests = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-upgraded-connections"); var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)); @@ -331,12 +331,12 @@ public async Task Http2Connection() var requestsReceived = 0; var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); - using var queuedConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); - using var queuedRequests = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-requests"); - using var tlsHandshakeDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "tls-handshake-duration"); - using var currentTlsHandshakes = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-tls-handshakes"); + using var connectionDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration"); + using var currentConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections"); + using var queuedConnections = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections"); + using var queuedRequests = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-requests"); + using var tlsHandshakeDuration = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "tls-handshake-duration"); + using var currentTlsHandshakes = new Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-tls-handshakes"); await using (var server = new TestServer(context => { diff --git a/src/Shared/Metrics/DefaultMeterFactory.cs b/src/Shared/Metrics/DefaultMeterFactory.cs index f6961526d1f7..87ac99a1adf3 100644 --- a/src/Shared/Metrics/DefaultMeterFactory.cs +++ b/src/Shared/Metrics/DefaultMeterFactory.cs @@ -27,10 +27,10 @@ public Meter CreateMeter(string name) public Meter CreateMeter(MeterOptions options) { - return CreateMeterCore(options.Name, options.Version, options.DefaultTags); + return CreateMeterCore(options.Name, options.Version, options.Tags); } - private Meter CreateMeterCore(string name, string? version, IList>? defaultTags) + private Meter CreateMeterCore(string name, string? version, IEnumerable>? defaultTags) { var tags = defaultTags?.ToArray(); if (tags != null) diff --git a/src/Shared/Metrics/IMeterFactory.cs b/src/Shared/Metrics/IMeterFactory.cs index 82563cc89701..ea5dd4bf6769 100644 --- a/src/Shared/Metrics/IMeterFactory.cs +++ b/src/Shared/Metrics/IMeterFactory.cs @@ -23,13 +23,6 @@ internal sealed class MetricsBuilder : IMetricsBuilder public IServiceCollection Services { get; } } -internal sealed class MeterOptions -{ - public required string Name { get; set; } - public string? Version { get; set; } - public IList>? DefaultTags { get; set; } -} - internal interface IMeterFactory { Meter CreateMeter(string name); diff --git a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs index 9d16f32f4a6b..9680d3079a85 100644 --- a/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs +++ b/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs @@ -1091,9 +1091,9 @@ public async Task Metrics() using (StartVerifiableLog()) { var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); - using var currentTransports = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-transports"); + using var connectionDuration = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); + using var currentConnections = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); + using var currentTransports = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-transports"); var metrics = new HttpConnectionsMetrics(testMeterFactory); var manager = CreateConnectionManager(LoggerFactory, metrics); diff --git a/src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs b/src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs index ff067e567f4a..fbffd7e838ae 100644 --- a/src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs +++ b/src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs @@ -430,8 +430,8 @@ public void Metrics() using (StartVerifiableLog()) { var testMeterFactory = new TestMeterFactory(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); + using var connectionDuration = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); + using var currentConnections = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); var connectionManager = CreateConnectionManager(LoggerFactory, metrics: new HttpConnectionsMetrics(testMeterFactory)); var connection = connectionManager.CreateConnection(); @@ -459,8 +459,8 @@ public void Metrics_ListenStartAfterConnection_Empty() var connectionManager = CreateConnectionManager(LoggerFactory, metrics: new HttpConnectionsMetrics(testMeterFactory)); var connection = connectionManager.CreateConnection(); - using var connectionDuration = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); - using var currentConnections = new InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); + using var connectionDuration = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration"); + using var currentConnections = new Microsoft.Extensions.Metrics.InstrumentRecorder(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections"); Assert.NotNull(connection.ConnectionId);