1 write to Value
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\CollectedMeasurement.cs (1)
36Value = value;
194 references to Value
Aspire.Confluent.Kafka.Tests (22)
MetricsTests.cs (22)
79Assert.Equal(100, collectorProducerQueueMessageCount.LastMeasurement!.Value); 83Assert.Equal(100, collectorConsumerQueueMessageCount.LastMeasurement!.Value); 87Assert.Equal(1638400, collectorProducerQueueSize.LastMeasurement!.Value); 91Assert.Equal(5, collectorNetworkTx.LastMeasurement!.Value); 96Assert.Equal(1638400, collectorNetworkTransmitted.LastMeasurement!.Value); 101Assert.Equal(5, collectorNetworkRx.LastMeasurement!.Value); 106Assert.Equal(1638400, collectorNetworkReceived.LastMeasurement!.Value); 111Assert.Equal(5, collectorMessageTx.LastMeasurement!.Value); 116Assert.Equal(1638400, collectorMessageTransmitted.LastMeasurement!.Value); 121Assert.Equal(5, collectorMessageRx.LastMeasurement!.Value); 126Assert.Equal(1638400, collectorMessageReceived.LastMeasurement!.Value); 196Assert.Equal(200, collectorProducerQueueMessageCount.LastMeasurement!.Value); 200Assert.Equal(200, collectorConsumerQueueMessageCount.LastMeasurement!.Value); 204Assert.Equal(3276800, collectorProducerQueueSize.LastMeasurement!.Value); 208Assert.Equal(5, collectorNetworkTx.LastMeasurement!.Value); 213Assert.Equal(1638400, collectorNetworkTransmitted.LastMeasurement!.Value); 218Assert.Equal(5, collectorNetworkRx.LastMeasurement!.Value); 223Assert.Equal(1638400, collectorNetworkReceived.LastMeasurement!.Value); 228Assert.Equal(5, collectorMessageTx.LastMeasurement!.Value); 233Assert.Equal(1638400, collectorMessageTransmitted.LastMeasurement!.Value); 238Assert.Equal(5, collectorMessageRx.LastMeasurement!.Value); 243Assert.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.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)); 258Assert.Equal(1, m.Value); 274Assert.Equal(1, m.Value); 280Assert.Equal(-1, m.Value); 317Assert.Equal(1, m.Value); 333Assert.Equal(1, m.Value); 339Assert.Equal(-1, m.Value); 346Assert.True(m.Value > 0); 377Assert.Equal(1, m.Value); 393Assert.Equal(1, m.Value); 399Assert.Equal(-1, m.Value); 432Assert.Equal(1, m.Value); 448Assert.Equal(1, m.Value); 454Assert.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)
234Assert.True(double.IsNaN(metricCollector.LastMeasurement.Value)); 240Assert.Equal(10, metricCollector.LastMeasurement.Value); // Consumed 10% of the CPU. 247Assert.Equal(10, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 254Assert.Equal(10, metricCollector.LastMeasurement.Value); // Consumed 10% of the CPU. 296Assert.NotNull(metricCollector.LastMeasurement?.Value); 297Assert.Equal(10, metricCollector.LastMeasurement.Value); // Consuming 10% of the memory initially. 302Assert.Equal(10, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 307Assert.Equal(30, metricCollector.LastMeasurement.Value); // Consuming 30% of the memory afterwards.
Windows\WindowsSnapshotProviderTests.cs (7)
94Assert.True(double.IsNaN(metricCollector.LastMeasurement.Value)); 99Assert.Equal(5, metricCollector.LastMeasurement?.Value); // Consuming 5% of the CPU (2 CPUs, 1000 ticks, 1ms). 106Assert.Equal(5, metricCollector.LastMeasurement?.Value); // Still consuming 5% of the CPU 127Assert.Equal(10, metricCollector.LastMeasurement.Value); // Consuming 5% of the memory initially 135Assert.Equal(10, metricCollector.LastMeasurement.Value); // Still consuming 10% as gauge wasn't updated. 141Assert.Equal(30, metricCollector.LastMeasurement.Value); // Consuming 30% of the memory afterwards 150Assert.Equal(100, 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);