1 write to Value
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\CollectedMeasurement.cs (1)
36Value = value;
212 references to Value
Aspire.Confluent.Kafka.Tests (22)
Aspire8MetricsTests.cs (22)
78Assert.Equal(100, collectorProducerQueueMessageCount.LastMeasurement!.Value); 82Assert.Equal(100, collectorConsumerQueueMessageCount.LastMeasurement!.Value); 86Assert.Equal(1638400, collectorProducerQueueSize.LastMeasurement!.Value); 90Assert.Equal(5, collectorNetworkTx.LastMeasurement!.Value); 95Assert.Equal(1638400, collectorNetworkTransmitted.LastMeasurement!.Value); 100Assert.Equal(5, collectorNetworkRx.LastMeasurement!.Value); 105Assert.Equal(1638400, collectorNetworkReceived.LastMeasurement!.Value); 110Assert.Equal(5, collectorMessageTx.LastMeasurement!.Value); 115Assert.Equal(1638400, collectorMessageTransmitted.LastMeasurement!.Value); 120Assert.Equal(5, collectorMessageRx.LastMeasurement!.Value); 125Assert.Equal(1638400, collectorMessageReceived.LastMeasurement!.Value); 193Assert.Equal(200, collectorProducerQueueMessageCount.LastMeasurement!.Value); 197Assert.Equal(200, collectorConsumerQueueMessageCount.LastMeasurement!.Value); 201Assert.Equal(3276800, collectorProducerQueueSize.LastMeasurement!.Value); 205Assert.Equal(5, collectorNetworkTx.LastMeasurement!.Value); 210Assert.Equal(1638400, collectorNetworkTransmitted.LastMeasurement!.Value); 215Assert.Equal(5, collectorNetworkRx.LastMeasurement!.Value); 220Assert.Equal(1638400, collectorNetworkReceived.LastMeasurement!.Value); 225Assert.Equal(5, collectorMessageTx.LastMeasurement!.Value); 230Assert.Equal(1638400, collectorMessageTransmitted.LastMeasurement!.Value); 235Assert.Equal(5, collectorMessageRx.LastMeasurement!.Value); 240Assert.Equal(1638400, collectorMessageReceived.LastMeasurement!.Value);
InMemory.FunctionalTests (10)
ConnectionLimitTests.cs (1)
168static void AssertCounter(CollectedMeasurement<long> measurement) => Assert.Equal(1, measurement.Value);
KestrelMetricsTests.cs (9)
516Assert.Collection(currentUpgradedRequests.GetMeasurementSnapshot(), m => Assert.Equal(1, m.Value), m => Assert.Equal(-1, m.Value)); 751Assert.True(m.Value > 0); 755Assert.Collection(activeTlsHandshakes.GetMeasurementSnapshot(), m => Assert.Equal(1, m.Value), m => Assert.Equal(-1, m.Value)); 759Assert.Equal(expectedValue, measurement.Value); 911Assert.True(m.Value > 0); 932Assert.True(measurement.Value > 0); 988Assert.Equal(expectedValue, measurement.Value);
Interop.FunctionalTests (2)
Http2\Http2RequestTests.cs (1)
144Assert.True(m.Value > 0);
Http3\Http3RequestTests.cs (1)
105Assert.True(m.Value > 0);
Microsoft.AspNetCore.Authentication.Test (12)
AuthenticationMetricsTest.cs (12)
37Assert.True(measurement.Value > 0); 65Assert.True(measurement.Value > 0); 93Assert.True(measurement.Value > 0); 122Assert.True(measurement.Value > 0); 147Assert.Equal(1, measurement.Value); 174Assert.Equal(1, measurement.Value); 198Assert.Equal(1, measurement.Value); 225Assert.Equal(1, measurement.Value); 249Assert.Equal(1, measurement.Value); 276Assert.Equal(1, measurement.Value); 300Assert.Equal(1, measurement.Value); 327Assert.Equal(1, measurement.Value);
Microsoft.AspNetCore.Authorization.Test (6)
AuthorizationMetricsTest.cs (6)
32Assert.Equal(1, measurement.Value); 57Assert.Equal(1, measurement.Value); 82Assert.Equal(1, measurement.Value); 111Assert.Equal(1, measurement.Value); 136Assert.Equal(1, measurement.Value); 165Assert.Equal(1, measurement.Value);
Microsoft.AspNetCore.Diagnostics.Tests (8)
DeveloperExceptionPageMiddlewareTest.cs (2)
616Assert.True(m.Value > 0); 626Assert.Equal(1, measurement.Value);
ExceptionHandlerMiddlewareTest.cs (3)
348Assert.True(m.Value > 0); 415Assert.True(m.Value > 0); 450Assert.Equal(1, measurement.Value);
ExceptionHandlerTest.cs (3)
1038Assert.True(m.Value > 0); 1108Assert.True(m.Value > 0); 1170Assert.True(m.Value > 0);
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingFeatureTests.cs (2)
152latest.Value.Should().Be(1); 210latest.Value.Should().Be(1);
Microsoft.AspNetCore.Hosting.Tests (49)
HostingApplicationDiagnosticsTests.cs (31)
86m => Assert.Equal(1, m.Value), 87m => Assert.Equal(-1, m.Value)); 89m => Assert.Equal(1, m.Value), 90m => Assert.Equal(-1, m.Value)); 92m => Assert.True(m.Value > 0)); 94m => Assert.True(m.Value > 0)); 120m => Assert.Equal(1, m.Value), 121m => Assert.Equal(-1, m.Value), 122m => Assert.Equal(1, m.Value), 123m => Assert.Equal(-1, m.Value)); 125m => Assert.Equal(1, m.Value), 126m => Assert.Equal(-1, m.Value), 127m => Assert.Equal(1, m.Value), 128m => Assert.Equal(-1, m.Value)); 130m => Assert.True(m.Value > 0), 131m => Assert.True(m.Value > 0)); 133m => Assert.True(m.Value > 0), 134m => Assert.True(m.Value > 0)); 263Assert.Equal(1, m.Value); 279Assert.Equal(1, m.Value); 285Assert.Equal(-1, m.Value); 322Assert.Equal(1, m.Value); 338Assert.Equal(1, m.Value); 344Assert.Equal(-1, m.Value); 351Assert.True(m.Value > 0); 382Assert.Equal(1, m.Value); 398Assert.Equal(1, m.Value); 404Assert.Equal(-1, m.Value); 437Assert.Equal(1, m.Value); 453Assert.Equal(1, m.Value); 459Assert.Equal(-1, m.Value);
HostingMetricsTests.cs (18)
42m => Assert.Equal(1, m.Value), 43m => Assert.Equal(-1, m.Value)); 54m => Assert.Equal(1, m.Value), 55m => Assert.Equal(-1, m.Value), 56m => Assert.Equal(1, m.Value), 57m => Assert.Equal(-1, m.Value)); 69m => Assert.Equal(1, m.Value), 70m => Assert.Equal(-1, m.Value), 71m => Assert.Equal(1, m.Value), 72m => Assert.Equal(-1, m.Value), 73m => Assert.Equal(1, m.Value)); 81m => Assert.Equal(1, m.Value), 82m => Assert.Equal(-1, m.Value), 83m => Assert.Equal(1, m.Value), 84m => Assert.Equal(-1, m.Value), 85m => Assert.Equal(1, m.Value), 86m => Assert.Equal(-1, m.Value)); 94Assert.True(measurement.Value > 0);
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
1168Assert.Equal(expected, measurement.Value); 1174Assert.True(measurement.Value > 0);
Microsoft.AspNetCore.RateLimiting.Tests (3)
RateLimitingMetricsTests.cs (3)
57Assert.Equal(1, m.Value); 313Assert.Equal(value, measurement.Value); 319Assert.True(measurement.Value > 0);
Microsoft.AspNetCore.Routing.Tests (2)
RoutingMetricsTests.cs (2)
138Assert.Equal(1, measurement.Value); 144Assert.Equal(1, measurement.Value);
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (2)
TelemetryHealthChecksPublisherTests.cs (2)
113latest.Value.Should().Be(1); 145return counter.Value;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (15)
Windows\WindowsContainerSnapshotProviderTests.cs (8)
240Assert.True(double.IsNaN(metricCollector.LastMeasurement.Value)); 246Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Consumed 10% of the CPU. 253Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 260Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Consumed 10% of the CPU. 308Assert.NotNull(metricCollector.LastMeasurement?.Value); 309Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Consuming 10% of the memory initially. 314Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 319Assert.Equal(0.3 * multiplier, metricCollector.LastMeasurement.Value); // Consuming 30% of the memory afterwards.
Windows\WindowsSnapshotProviderTests.cs (7)
100Assert.True(double.IsNaN(metricCollector.LastMeasurement.Value)); 105Assert.Equal(0.05 * multiplier, metricCollector.LastMeasurement?.Value); // Consuming 5% of the CPU (2 CPUs, 1000 ticks, 1ms). 112Assert.Equal(0.05 * multiplier, metricCollector.LastMeasurement?.Value); // Still consuming 5% of the CPU 139Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Consuming 5% of the memory initially 147Assert.Equal(0.1 * multiplier, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 153Assert.Equal(0.3 * multiplier, metricCollector.LastMeasurement.Value); // Consuming 30% of the memory afterwards 162Assert.Equal(1 * multiplier, Math.Round(metricCollector.LastMeasurement.Value)); // Consuming 100% of the memory
Microsoft.Extensions.Diagnostics.Testing (8)
Metrics\CollectedMeasurement.cs (1)
109internal string DebuggerToString() => $"{Value} @ {Timestamp.ToString("HH:mm:ss.ffff", CultureInfo.InvariantCulture)}";
Metrics\MeasurementExtensions.cs (7)
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), 86sum += measurement.Value; 97sum += measurement.Value;
Microsoft.Extensions.Diagnostics.Testing.Tests (19)
Metrics\MeasurementExtensionsTests.cs (8)
29Assert.Equal(1, filtered[0].Value); 30Assert.Equal(2, filtered[1].Value); 54Assert.Equal(1, filtered[0].Value); 55Assert.Equal(2, filtered[1].Value); 79Assert.Equal(1, filtered[0].Value); 80Assert.Equal(2, filtered[1].Value); 107Assert.Equal(1, filtered[0].Value); 108Assert.Equal(2, filtered[1].Value);
Metrics\MetricCollectorTests.cs (11)
65Assert.Equal(3, collector.LastMeasurement.Value); 75Assert.Equal(2, collector.LastMeasurement.Value); 110Assert.Equal(3, collector.LastMeasurement.Value); 120Assert.Equal(2, collector.LastMeasurement.Value); 157Assert.Equal(3, collector.LastMeasurement.Value); 167Assert.Equal(2, collector.LastMeasurement.Value); 218Assert.Equal(3, collector.LastMeasurement.Value); 228Assert.Equal(2, collector.LastMeasurement.Value); 402Assert.Equal(1, snap[0].Value); 406Assert.Equal(2, snap[1].Value); 410Assert.Equal(3, snap[2].Value);
Microsoft.Gen.Metrics.Generated.Tests (50)
MetricTests.cs (32)
56Assert.Collection(measurements, x => Assert.Equal(10L, x.Value), x => Assert.Equal(5L, x.Value)); 70Assert.Equal(Value, measurement.Value); 83Assert.Collection(measurements, x => Assert.Equal(12L, x.Value), x => Assert.Equal(6L, x.Value)); 97Assert.Equal(Value, measurement.Value); 111Assert.Collection(measurements, x => Assert.Equal(10, x.Value), x => Assert.Equal(5, x.Value)); 125Assert.Equal(Value, measurement.Value); 139Assert.Collection(measurements, x => Assert.Equal(12, x.Value), x => Assert.Equal(6, x.Value)); 153Assert.Equal(Value, measurement.Value); 172Assert.All(measurements, x => Assert.Equal(Value, x.Value)); 196Assert.All(measurements, x => Assert.Equal(Value, x.Value)); 252Assert.Equal(17L, measurement.Value); 258Assert.Equal(5L, measurement.Value); 265Assert.Equal(5L, measurement.Value); 277Assert.Equal(10L, measurement.Value); 283Assert.Equal(5L, measurement.Value); 290Assert.Equal(5L, measurement.Value); 302Assert.Equal(12L, measurement.Value); 315Assert.Equal(1.05D, measurement.Value); 328Assert.Equal(100_500L, measurement.Value); 341Assert.Equal(100L, measurement.Value); 362Assert.Equal(10L, measurement.Value); 406Assert.Equal(1L, measurement.Value); 429Assert.Equal(2L, measurement.Value); 452Assert.Equal(3L, measurement.Value); 505Assert.Equal(11L, measurement.Value); 549Assert.Equal(1M, measurement.Value); 572Assert.Equal(2M, measurement.Value); 594Assert.Equal(3M, measurement.Value);
MetricTests.Ext.cs (18)
42Assert.Collection(measurements, x => Assert.Equal(10L, x.Value), x => Assert.Equal(5L, x.Value)); 54Assert.Equal(11L, measurement.Value); 67Assert.Collection(measurements, x => Assert.Equal(12L, x.Value), x => Assert.Equal(6L, x.Value)); 80Assert.Equal(17L, measurement.Value); 94Assert.Collection(measurements, x => Assert.Equal(10, x.Value), x => Assert.Equal(5, x.Value)); 107Assert.Equal(11, measurement.Value); 121Assert.Collection(measurements, x => Assert.Equal(12, x.Value), x => Assert.Equal(6, x.Value)); 134Assert.Equal(17, measurement.Value); 169Assert.Equal(1L, measurement.Value); 191Assert.Equal(2L, measurement.Value); 213Assert.Equal(3L, measurement.Value); 262Assert.Equal(1M, measurement.Value); 284Assert.Equal(2M, measurement.Value); 306Assert.Equal(3M, measurement.Value);