1 instantiation of CollectedMeasurement
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\MetricCollector.cs (1)
298var m = new CollectedMeasurement<T>(measurement, tags, _timeProvider.GetUtcNow());
64 references to CollectedMeasurement
InMemory.FunctionalTests (4)
ConnectionLimitTests.cs (1)
168static void AssertCounter(CollectedMeasurement<long> measurement) => Assert.Equal(1, measurement.Value);
KestrelMetricsTests.cs (3)
757static void AssertRequestCount(CollectedMeasurement<long> measurement, long expectedValue, string httpVersion) 930private static void AssertDuration(CollectedMeasurement<double> measurement, string localAddress, int? localPort, string networkTransport, string networkType, string httpVersion, string tlsProtocolVersion = null, string error = null) 986private static void AssertCount(CollectedMeasurement<long> measurement, long expectedValue, string localAddress, int? localPort, string networkTransport, string networkType)
Microsoft.AspNetCore.Diagnostics.Tests (2)
DeveloperExceptionPageMiddlewareTest.cs (1)
624private static void AssertRequestException(CollectedMeasurement<long> measurement, string exceptionName, string result, string handler = null)
ExceptionHandlerMiddlewareTest.cs (1)
448private static void AssertRequestException(CollectedMeasurement<long> measurement, string exceptionName, string result, string handler = null)
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingFeatureTests.cs (2)
150var latest = metricCollector.LastMeasurement; 208var latest = metricCollector.LastMeasurement;
Microsoft.AspNetCore.Hosting.Tests (1)
HostingMetricsTests.cs (1)
92static void AssertRequestDuration(CollectedMeasurement<double> measurement, string httpVersion, int statusCode, string exceptionName = null, bool? unhandledRequest = null)
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
1166private static void AssertTransport(CollectedMeasurement<long> measurement, long expected, string transportType) 1172private static void AssertDuration(CollectedMeasurement<double> measurement, string status, string transportType)
Microsoft.AspNetCore.RateLimiting.Tests (2)
RateLimitingMetricsTests.cs (2)
311private static void AssertCounter(CollectedMeasurement<long> measurement, long value, string policy) 317private static void AssertDuration(CollectedMeasurement<double> measurement, string policy)
Microsoft.AspNetCore.Routing.Tests (2)
RoutingMetricsTests.cs (2)
136private void AssertFailure(CollectedMeasurement<long> measurement) 142private void AssertSuccess(CollectedMeasurement<long> measurement, string route, bool fallback)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
TelemetryHealthChecksPublisherTests.cs (3)
109var latest = healthyMetricCollector.LastMeasurement; 138private static long GetValue(IReadOnlyCollection<CollectedMeasurement<long>> counters, string healthy, string status) 140foreach (var counter in counters)
Microsoft.Extensions.Diagnostics.Testing (25)
Metrics\CollectedMeasurement.cs (1)
21/// Initializes a new instance of the <see cref="CollectedMeasurement{T}"/> class.
Metrics\MeasurementExtensions.cs (20)
22public static IEnumerable<CollectedMeasurement<T>> ContainsTags<T>(this IEnumerable<CollectedMeasurement<T>> measurements, params KeyValuePair<string, object?>[] tags) 33public static IEnumerable<CollectedMeasurement<T>> ContainsTags<T>(this IEnumerable<CollectedMeasurement<T>> measurements, params string[] tags) 44public static IEnumerable<CollectedMeasurement<T>> MatchesTags<T>(this IEnumerable<CollectedMeasurement<T>> measurements, params KeyValuePair<string, object?>[] tags) 55public static IEnumerable<CollectedMeasurement<T>> MatchesTags<T>(this IEnumerable<CollectedMeasurement<T>> measurements, params string[] tags) 65public static T EvaluateAsCounter<T>(this IEnumerable<CollectedMeasurement<T>> measurements) 71IEnumerable<CollectedMeasurement<byte>> l => (T)(object)ByteSum(l), 72IEnumerable<CollectedMeasurement<short>> l => (T)(object)ShortSum(l), 73IEnumerable<CollectedMeasurement<int>> l => (T)(object)l.Sum(m => m.Value), 74IEnumerable<CollectedMeasurement<long>> l => (T)(object)l.Sum(m => m.Value), 75IEnumerable<CollectedMeasurement<float>> l => (T)(object)l.Sum(m => m.Value), 76IEnumerable<CollectedMeasurement<double>> l => (T)(object)l.Sum(m => m.Value), 77IEnumerable<CollectedMeasurement<decimal>> l => (T)(object)l.Sum(m => m.Value), 81static byte ByteSum(IEnumerable<CollectedMeasurement<byte>> measurements) 84foreach (var measurement in measurements) 92static short ShortSum(IEnumerable<CollectedMeasurement<short>> measurements) 95foreach (var measurement in measurements)
Metrics\MetricCollector.cs (4)
37private readonly List<CollectedMeasurement<T>> _measurements = []; 172public IReadOnlyList<CollectedMeasurement<T>> GetMeasurementSnapshot(bool clear = false) 191public CollectedMeasurement<T>? LastMeasurement 298var m = new CollectedMeasurement<T>(measurement, tags, _timeProvider.GetUtcNow());
Microsoft.Gen.Metrics.Generated.Tests (20)
MetricTests.cs (14)
69var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 96var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 124var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 152var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 251var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 276var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 301var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 314var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 327var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 340var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 361var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 405var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 504var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 548var measurement = Assert.Single(collector.GetMeasurementSnapshot());
MetricTests.Ext.cs (6)
53var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 79var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 106var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 133var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 168var measurement = Assert.Single(collector.GetMeasurementSnapshot()); 261var measurement = Assert.Single(collector.GetMeasurementSnapshot());
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
462var measurement = connectionDuration.GetMeasurementSnapshot().First();