381 references to GetMeasurementSnapshot
InMemory.FunctionalTests (80)
KestrelMetricsTests.cs (36)
78Assert.Empty(connectionDuration.GetMeasurementSnapshot());
79Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
94Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
99Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
100Assert.Collection(queuedConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
153Assert.Empty(connectionDuration.GetMeasurementSnapshot());
154Assert.Empty(activeConnections.GetMeasurementSnapshot());
155Assert.Empty(queuedConnections.GetMeasurementSnapshot());
196Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
260Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
311Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
366Assert.Empty(connectionDuration.GetMeasurementSnapshot());
367Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
382Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
388Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
389Assert.Collection(queuedConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
425Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
471Assert.Empty(connectionDuration.GetMeasurementSnapshot());
472Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
482Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
486Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
487Assert.Collection(queuedConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
514Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => AssertDuration(m, "127.0.0.1", localPort: 0, "tcp", "ipv4", KestrelMetrics.Http11));
515Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
516Assert.Collection(currentUpgradedRequests.GetMeasurementSnapshot(), m => Assert.Equal(1, m.Value), m => Assert.Equal(-1, m.Value));
601Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => AssertDuration(m, "127.0.0.1", localPort: 0, "tcp", "ipv4", KestrelMetrics.Http2));
663Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => AssertDuration(m, "127.0.0.1", localPort: 0, "tcp", "ipv4", KestrelMetrics.Http2, error: KestrelMetrics.GetErrorType(ConnectionEndReason.AppShutdownTimeout)));
739Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => AssertDuration(m, "127.0.0.1", localPort: 0, "tcp", "ipv4", KestrelMetrics.Http2, "1.2"));
740Assert.Collection(activeConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
741Assert.Collection(queuedConnections.GetMeasurementSnapshot(), m => AssertCount(m, 1, "127.0.0.1", localPort: 0, "tcp", "ipv4"), m => AssertCount(m, -1, "127.0.0.1", localPort: 0, "tcp", "ipv4"));
743Assert.Collection(queuedRequests.GetMeasurementSnapshot(),
749Assert.Collection(tlsHandshakeDuration.GetMeasurementSnapshot(), m =>
755Assert.Collection(activeTlsHandshakes.GetMeasurementSnapshot(), m => Assert.Equal(1, m.Value), m => Assert.Equal(-1, m.Value));
832Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => AssertDuration(m, "127.0.0.1", localPort: 0, "tcp", "ipv4", KestrelMetrics.Http2));
904Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m =>
909Assert.Collection(tlsHandshakeDuration.GetMeasurementSnapshot(), m =>
ResponseTests.cs (9)
210Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.WriteCanceled, m.Tags));
708Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.Tags));
988Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ResponseContentLengthMismatch, m.Tags));
1026Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ResponseContentLengthMismatch, m.Tags));
2654Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.Tags));
2856Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.Tags));
2901Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ErrorAfterStartingResponse, m.Tags));
2946Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ErrorAfterStartingResponse, m.Tags));
3029Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.AbortedByApp, m.Tags));
Interop.FunctionalTests (2)
Microsoft.AspNetCore.Authentication.Test (12)
Microsoft.AspNetCore.Authorization.Test (6)
Microsoft.AspNetCore.Components.Server.Tests (8)
Microsoft.AspNetCore.Components.Tests (21)
Microsoft.AspNetCore.Diagnostics.Tests (15)
Microsoft.AspNetCore.Hosting.Tests (32)
HostingApplicationDiagnosticsTests.cs (22)
84Assert.Collection(activeRequestsCollector1.GetMeasurementSnapshot(),
87Assert.Collection(activeRequestsCollector2.GetMeasurementSnapshot(),
90Assert.Collection(requestDurationCollector1.GetMeasurementSnapshot(),
92Assert.Collection(requestDurationCollector2.GetMeasurementSnapshot(),
118Assert.Collection(activeRequestsCollector1.GetMeasurementSnapshot(),
123Assert.Collection(activeRequestsCollector2.GetMeasurementSnapshot(),
128Assert.Collection(requestDurationCollector1.GetMeasurementSnapshot(),
131Assert.Collection(requestDurationCollector2.GetMeasurementSnapshot(),
259Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
275Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
318Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
334Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
347Assert.Collection(requestDurationCollector.GetMeasurementSnapshot(),
383Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
399Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
412Assert.Collection(requestDurationCollector.GetMeasurementSnapshot(),
443Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
459Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
472Assert.Empty(requestDurationCollector.GetMeasurementSnapshot());
498Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
514Assert.Collection(activeRequestsCollector.GetMeasurementSnapshot(),
527Assert.Empty(requestDurationCollector.GetMeasurementSnapshot());
Microsoft.AspNetCore.Http.Connections.Tests (4)
Microsoft.AspNetCore.Identity.Test (40)
SignInManagerTest.cs (18)
70Assert.Collection(authenticate.GetMeasurementSnapshot(),
79Assert.Empty(signInUserPrincipal.GetMeasurementSnapshot());
114Assert.Collection(checkPasswordSignIn.GetMeasurementSnapshot(),
394Assert.Collection(authenticate.GetMeasurementSnapshot(),
403Assert.Collection(signInUserPrincipal.GetMeasurementSnapshot(),
413Assert.Collection(authenticate.GetMeasurementSnapshot(),
422Assert.Empty(signInUserPrincipal.GetMeasurementSnapshot());
471Assert.Collection(authenticate.GetMeasurementSnapshot(),
480Assert.Collection(signInUserPrincipal.GetMeasurementSnapshot(),
799Assert.Collection(signInUserPrincipal.GetMeasurementSnapshot(),
857Assert.Collection(authenticate.GetMeasurementSnapshot(),
894Assert.Collection(authenticate.GetMeasurementSnapshot(),
901Assert.Empty(signInUserPrincipal.GetMeasurementSnapshot());
1068Assert.Collection(rememberTwoFactorClient.GetMeasurementSnapshot(),
1100Assert.Collection(forgetTwoFactorClient.GetMeasurementSnapshot(),
1171Assert.Collection(signOutUserPrincipal.GetMeasurementSnapshot(),
1196Assert.Collection(signOutUserPrincipal.GetMeasurementSnapshot(),
1232Assert.Collection(authenticate.GetMeasurementSnapshot(),
UserManagerTest.cs (22)
145Assert.Collection(deleteUser.GetMeasurementSnapshot(),
172Assert.Collection(deleteUser.GetMeasurementSnapshot(),
585Assert.Collection(updateUser.GetMeasurementSnapshot(),
617Assert.Collection(updateUser.GetMeasurementSnapshot(),
659Assert.Collection(updateUser.GetMeasurementSnapshot(),
665Assert.Collection(checkPassword.GetMeasurementSnapshot(),
691Assert.Collection(createUser.GetMeasurementSnapshot(),
718Assert.Collection(updateUser.GetMeasurementSnapshot(),
749Assert.Collection(updateUser.GetMeasurementSnapshot(),
780Assert.Collection(updateUser.GetMeasurementSnapshot(),
872Assert.Collection(checkPassword.GetMeasurementSnapshot(),
901Assert.Collection(updateUser.GetMeasurementSnapshot(),
926Assert.Collection(updateUser.GetMeasurementSnapshot(),
953Assert.Collection(generateToken.GetMeasurementSnapshot(),
959Assert.Collection(verifyToken.GetMeasurementSnapshot(),
984Assert.Collection(createUser.GetMeasurementSnapshot(),
989Assert.Collection(updateUser.GetMeasurementSnapshot(),
1005Assert.Collection(checkPassword.GetMeasurementSnapshot(),
1030Assert.Collection(updateUser.GetMeasurementSnapshot(),
1036Assert.Collection(generateToken.GetMeasurementSnapshot(),
1057Assert.Collection(updateUser.GetMeasurementSnapshot(),
1083Assert.Collection(updateUser.GetMeasurementSnapshot(),
Microsoft.AspNetCore.RateLimiting.Tests (22)
RateLimitingMetricsTests.cs (22)
50Assert.Empty(currentLeaseRequestsCollector.GetMeasurementSnapshot());
51Assert.Empty(leaseRequestDurationCollector.GetMeasurementSnapshot());
52Assert.Empty(currentRequestsQueuedCollector.GetMeasurementSnapshot());
53Assert.Empty(queuedRequestDurationCollector.GetMeasurementSnapshot());
54Assert.Collection(rateLimitingRequestsCollector.GetMeasurementSnapshot(),
96Assert.Collection(currentLeaseRequestsCollector.GetMeasurementSnapshot(),
98Assert.Empty(leaseRequestDurationCollector.GetMeasurementSnapshot());
107Assert.Collection(currentLeaseRequestsCollector.GetMeasurementSnapshot(),
110Assert.Collection(leaseRequestDurationCollector.GetMeasurementSnapshot(),
112Assert.Empty(currentRequestsQueuedCollector.GetMeasurementSnapshot());
113Assert.Empty(queuedRequestDurationCollector.GetMeasurementSnapshot());
114Assert.Collection(rateLimitingRequestsCollector.GetMeasurementSnapshot(),
162Assert.Empty(currentLeaseRequestsCollector.GetMeasurementSnapshot());
163Assert.Collection(leaseRequestDurationCollector.GetMeasurementSnapshot(),
221Assert.Collection(currentRequestsQueuedCollector.GetMeasurementSnapshot(),
223Assert.Empty(queuedRequestDurationCollector.GetMeasurementSnapshot());
231Assert.Collection(currentRequestsQueuedCollector.GetMeasurementSnapshot(),
234Assert.Collection(queuedRequestDurationCollector.GetMeasurementSnapshot(),
297Assert.Empty(currentRequestsQueuedCollector.GetMeasurementSnapshot());
298Assert.Empty(queuedRequestDurationCollector.GetMeasurementSnapshot());
306Assert.Empty(currentRequestsQueuedCollector.GetMeasurementSnapshot());
307Assert.Collection(queuedRequestDurationCollector.GetMeasurementSnapshot(),
Microsoft.AspNetCore.Routing.Tests (5)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (17)
PinnedBlockMemoryPoolTests.cs (17)
239Assert.Empty(currentMemoryMetric.GetMeasurementSnapshot());
244Assert.Collection(currentMemoryMetric.GetMeasurementSnapshot(),
260Assert.Equal(2 * PinnedBlockMemoryPool.BlockSize, currentMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
269Assert.Equal(0, currentMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
280Assert.Empty(totalMemoryMetric.GetMeasurementSnapshot());
285Assert.Collection(totalMemoryMetric.GetMeasurementSnapshot(),
298Assert.Equal(2 * PinnedBlockMemoryPool.BlockSize, totalMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
304Assert.Equal(2 * PinnedBlockMemoryPool.BlockSize, totalMemoryMetric.GetMeasurementSnapshot().EvaluateAsCounter());
315Assert.Empty(rentMetric.GetMeasurementSnapshot());
321Assert.Collection(rentMetric.GetMeasurementSnapshot(),
337Assert.Equal(2 * PinnedBlockMemoryPool.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());
360Assert.Empty(evictMetric.GetMeasurementSnapshot());
369Assert.NotEmpty(evictMetric.GetMeasurementSnapshot());
370foreach (var measurement in evictMetric.GetMeasurementSnapshot())
391Assert.Equal(2 * PinnedBlockMemoryPool.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());
400Assert.Equal(4 * PinnedBlockMemoryPool.BlockSize, rentMetric.GetMeasurementSnapshot().EvaluateAsCounter());
419Assert.Collection(rentMetric.GetMeasurementSnapshot(),
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (28)
Microsoft.Extensions.Diagnostics.Testing.Tests (39)
Metrics\MetricCollectorTests.cs (28)
52Assert.Empty(collector.GetMeasurementSnapshot());
63Assert.Single(collector.GetMeasurementSnapshot());
64Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
73Assert.Equal(2, collector.GetMeasurementSnapshot().Count);
74Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
81Assert.Empty(collector.GetMeasurementSnapshot());
98Assert.Empty(collector.GetMeasurementSnapshot());
108Assert.Single(collector.GetMeasurementSnapshot());
109Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
118Assert.Equal(2, collector.GetMeasurementSnapshot().Count);
119Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
126Assert.Empty(collector.GetMeasurementSnapshot());
145Assert.Empty(collector.GetMeasurementSnapshot());
155Assert.Single(collector.GetMeasurementSnapshot());
156Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
165Assert.Equal(2, collector.GetMeasurementSnapshot().Count);
166Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
173Assert.Empty(collector.GetMeasurementSnapshot());
206Assert.Empty(collector.GetMeasurementSnapshot());
216Assert.Single(collector.GetMeasurementSnapshot());
217Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
226Assert.Equal(2, collector.GetMeasurementSnapshot().Count);
227Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.LastMeasurement);
361Assert.Throws<ObjectDisposedException>(() => collector.GetMeasurementSnapshot());
398var snap = collector.GetMeasurementSnapshot();
400Assert.Equal(3, collector.GetMeasurementSnapshot().Count);
414snap = collector.GetMeasurementSnapshot(true);
416Assert.Empty(collector.GetMeasurementSnapshot());
Microsoft.Gen.Metrics.Generated.Tests (42)
Sockets.FunctionalTests (7)