151 references to LastMeasurement
Aspire.Confluent.Kafka.Tests (82)
MetricsTests.cs (82)
79
Assert.Equal(100, collectorProducerQueueMessageCount.
LastMeasurement
!.Value);
80
Assert.Contains(collectorProducerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
81
Assert.Contains(collectorProducerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
83
Assert.Equal(100, collectorConsumerQueueMessageCount.
LastMeasurement
!.Value);
84
Assert.Contains(collectorConsumerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
85
Assert.Contains(collectorConsumerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
87
Assert.Equal(1638400, collectorProducerQueueSize.
LastMeasurement
!.Value);
88
Assert.Contains(collectorProducerQueueSize.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
89
Assert.Contains(collectorProducerQueueSize.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
91
Assert.Equal(5, collectorNetworkTx.
LastMeasurement
!.Value);
92
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
93
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
94
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
96
Assert.Equal(1638400, collectorNetworkTransmitted.
LastMeasurement
!.Value);
97
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
98
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
99
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
101
Assert.Equal(5, collectorNetworkRx.
LastMeasurement
!.Value);
102
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
103
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
104
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
106
Assert.Equal(1638400, collectorNetworkReceived.
LastMeasurement
!.Value);
107
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
108
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
109
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
111
Assert.Equal(5, collectorMessageTx.
LastMeasurement
!.Value);
112
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
113
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
114
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
116
Assert.Equal(1638400, collectorMessageTransmitted.
LastMeasurement
!.Value);
117
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
118
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
119
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
121
Assert.Equal(5, collectorMessageRx.
LastMeasurement
!.Value);
122
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
123
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
124
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
126
Assert.Equal(1638400, collectorMessageReceived.
LastMeasurement
!.Value);
127
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
128
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
129
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
196
Assert.Equal(200, collectorProducerQueueMessageCount.
LastMeasurement
!.Value);
197
Assert.Contains(collectorProducerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
198
Assert.Contains(collectorProducerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
200
Assert.Equal(200, collectorConsumerQueueMessageCount.
LastMeasurement
!.Value);
201
Assert.Contains(collectorConsumerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
202
Assert.Contains(collectorConsumerQueueMessageCount.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
204
Assert.Equal(3276800, collectorProducerQueueSize.
LastMeasurement
!.Value);
205
Assert.Contains(collectorProducerQueueSize.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
206
Assert.Contains(collectorProducerQueueSize.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
208
Assert.Equal(5, collectorNetworkTx.
LastMeasurement
!.Value);
209
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
210
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
211
Assert.Contains(collectorNetworkTx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
213
Assert.Equal(1638400, collectorNetworkTransmitted.
LastMeasurement
!.Value);
214
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
215
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
216
Assert.Contains(collectorNetworkTransmitted.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
218
Assert.Equal(5, collectorNetworkRx.
LastMeasurement
!.Value);
219
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
220
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
221
Assert.Contains(collectorNetworkRx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
223
Assert.Equal(1638400, collectorNetworkReceived.
LastMeasurement
!.Value);
224
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
225
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
226
Assert.Contains(collectorNetworkReceived.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
228
Assert.Equal(5, collectorMessageTx.
LastMeasurement
!.Value);
229
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
230
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
231
Assert.Contains(collectorMessageTx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
233
Assert.Equal(1638400, collectorMessageTransmitted.
LastMeasurement
!.Value);
234
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
235
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
236
Assert.Contains(collectorMessageTransmitted.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
238
Assert.Equal(5, collectorMessageRx.
LastMeasurement
!.Value);
239
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
240
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
241
Assert.Contains(collectorMessageRx.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
243
Assert.Equal(1638400, collectorMessageReceived.
LastMeasurement
!.Value);
244
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
245
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
246
Assert.Contains(collectorMessageReceived.
LastMeasurement
!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingFeatureTests.cs (2)
150
var latest = metricCollector.
LastMeasurement
;
208
var latest = metricCollector.
LastMeasurement
;
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (1)
TelemetryHealthChecksPublisherTests.cs (1)
109
var latest = healthyMetricCollector.
LastMeasurement
;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (18)
Windows\WindowsContainerSnapshotProviderTests.cs (9)
233
Assert.NotNull(metricCollector.
LastMeasurement
);
234
Assert.True(double.IsNaN(metricCollector.
LastMeasurement
.Value));
240
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Consumed 10% of the CPU.
247
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Still consuming 10% as gauge wasn't updated.
254
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Consumed 10% of the CPU.
296
Assert.NotNull(metricCollector.
LastMeasurement
?.Value);
297
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Consuming 10% of the memory initially.
302
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Still consuming 10% as gauge wasn't updated.
307
Assert.Equal(30, metricCollector.
LastMeasurement
.Value); // Consuming 30% of the memory afterwards.
Windows\WindowsSnapshotProviderTests.cs (9)
93
Assert.NotNull(metricCollector.
LastMeasurement
);
94
Assert.True(double.IsNaN(metricCollector.
LastMeasurement
.Value));
99
Assert.Equal(5, metricCollector.
LastMeasurement
?.Value); // Consuming 5% of the CPU (2 CPUs, 1000 ticks, 1ms).
106
Assert.Equal(5, metricCollector.
LastMeasurement
?.Value); // Still consuming 5% of the CPU
126
Assert.NotNull(metricCollector.
LastMeasurement
);
127
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Consuming 5% of the memory initially
135
Assert.Equal(10, metricCollector.
LastMeasurement
.Value); // Still consuming 10% as gauge wasn't updated.
141
Assert.Equal(30, metricCollector.
LastMeasurement
.Value); // Consuming 30% of the memory afterwards
150
Assert.Equal(100, metricCollector.
LastMeasurement
.Value); // Consuming 100% of the memory
Microsoft.Extensions.Diagnostics.Testing.Tests (48)
Metrics\MetricCollectorTests.cs (48)
53
Assert.Null(collector.
LastMeasurement
);
60
Assert.NotNull(collector.
LastMeasurement
);
64
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
65
Assert.Equal(3, collector.
LastMeasurement
.Value);
66
Assert.Empty(collector.
LastMeasurement
.Tags);
67
Assert.Equal(now, collector.
LastMeasurement
.Timestamp);
74
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
75
Assert.Equal(2, collector.
LastMeasurement
.Value);
76
Assert.Empty(collector.
LastMeasurement
.Tags);
77
Assert.Equal(timeProvider.GetUtcNow(), collector.
LastMeasurement
.Timestamp);
82
Assert.Null(collector.
LastMeasurement
);
83
Assert.Null(collector.
LastMeasurement
);
99
Assert.Null(collector.
LastMeasurement
);
105
Assert.NotNull(collector.
LastMeasurement
);
109
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
110
Assert.Equal(3, collector.
LastMeasurement
.Value);
111
Assert.Empty(collector.
LastMeasurement
.Tags);
112
Assert.Equal(now, collector.
LastMeasurement
.Timestamp);
119
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
120
Assert.Equal(2, collector.
LastMeasurement
.Value);
121
Assert.Empty(collector.
LastMeasurement
.Tags);
122
Assert.Equal(timeProvider.GetUtcNow(), collector.
LastMeasurement
.Timestamp);
127
Assert.Null(collector.
LastMeasurement
);
128
Assert.Null(collector.
LastMeasurement
);
146
Assert.Null(collector.
LastMeasurement
);
152
Assert.NotNull(collector.
LastMeasurement
);
156
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
157
Assert.Equal(3, collector.
LastMeasurement
.Value);
158
Assert.Empty(collector.
LastMeasurement
.Tags);
159
Assert.Equal(now, collector.
LastMeasurement
.Timestamp);
166
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
167
Assert.Equal(2, collector.
LastMeasurement
.Value);
168
Assert.Empty(collector.
LastMeasurement
.Tags);
169
Assert.Equal(timeProvider.GetUtcNow(), collector.
LastMeasurement
.Timestamp);
174
Assert.Null(collector.
LastMeasurement
);
175
Assert.Null(collector.
LastMeasurement
);
177
Assert.Null(collector2.
LastMeasurement
);
207
Assert.Null(collector.
LastMeasurement
);
213
Assert.NotNull(collector.
LastMeasurement
);
217
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
218
Assert.Equal(3, collector.
LastMeasurement
.Value);
219
Assert.Empty(collector.
LastMeasurement
.Tags);
220
Assert.Equal(now, collector.
LastMeasurement
.Timestamp);
227
Assert.Same(collector.GetMeasurementSnapshot().Last(), collector.
LastMeasurement
);
228
Assert.Equal(2, collector.
LastMeasurement
.Value);
229
Assert.Empty(collector.
LastMeasurement
.Tags);
230
Assert.Equal(timeProvider.GetUtcNow(), collector.
LastMeasurement
.Timestamp);
363
Assert.Throws<ObjectDisposedException>(() => collector.
LastMeasurement
);