Skip to content

Commit d6c5d0d

Browse files
roypatShadowCurse
authored andcommitted
remove unused metrics
Remove metrics that were never incremented. Closes #2901 Signed-off-by: Patrick Roy <[email protected]>
1 parent c3fbe05 commit d6c5d0d

File tree

5 files changed

+5
-31
lines changed

5 files changed

+5
-31
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ and this project adheres to
1616

1717
### Removed
1818

19+
- [#5439](https://github.com/firecracker-microvm/firecracker/pull/5439): Removed
20+
the `rx_partial_writes`, `tx_partial_reads`, `sync_response_fails`,
21+
`sync_vmm_send_timeout_count`, `deprecated_cmd_line_api_calls`, `log_fails`
22+
and `device_events` metrics, as they were never incremented.
23+
1924
### Fixed
2025

2126
- [#5418](https://github.com/firecracker-microvm/firecracker/pull/5418): Fixed

src/vmm/src/devices/virtio/net/metrics.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ pub struct NetDeviceMetrics {
161161
pub rx_queue_event_count: SharedIncMetric,
162162
/// Number of events associated with the rate limiter installed on the receiving path.
163163
pub rx_event_rate_limiter_count: SharedIncMetric,
164-
/// Number of RX partial writes to guest.
165-
pub rx_partial_writes: SharedIncMetric,
166164
/// Number of RX rate limiter throttling events.
167165
pub rx_rate_limiter_throttled: SharedIncMetric,
168166
/// Number of events received on the associated tap.
@@ -191,8 +189,6 @@ pub struct NetDeviceMetrics {
191189
pub tx_count: SharedIncMetric,
192190
/// Number of transmitted packets.
193191
pub tx_packets_count: SharedIncMetric,
194-
/// Number of TX partial reads from guest.
195-
pub tx_partial_reads: SharedIncMetric,
196192
/// Number of events associated with the transmitting queue.
197193
pub tx_queue_event_count: SharedIncMetric,
198194
/// Number of events associated with the rate limiter installed on the transmitting path.
@@ -233,8 +229,6 @@ impl NetDeviceMetrics {
233229
.add(other.rx_queue_event_count.fetch_diff());
234230
self.rx_event_rate_limiter_count
235231
.add(other.rx_event_rate_limiter_count.fetch_diff());
236-
self.rx_partial_writes
237-
.add(other.rx_partial_writes.fetch_diff());
238232
self.rx_rate_limiter_throttled
239233
.add(other.rx_rate_limiter_throttled.fetch_diff());
240234
self.rx_tap_event_count
@@ -256,8 +250,6 @@ impl NetDeviceMetrics {
256250
self.tx_count.add(other.tx_count.fetch_diff());
257251
self.tx_packets_count
258252
.add(other.tx_packets_count.fetch_diff());
259-
self.tx_partial_reads
260-
.add(other.tx_partial_reads.fetch_diff());
261253
self.tx_queue_event_count
262254
.add(other.tx_queue_event_count.fetch_diff());
263255
self.tx_rate_limiter_event_count

src/vmm/src/logger/metrics.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,13 @@ pub struct ApiServerMetrics {
337337
pub process_startup_time_us: SharedStoreMetric,
338338
/// Measures the cpu's startup time in microseconds.
339339
pub process_startup_time_cpu_us: SharedStoreMetric,
340-
/// Number of failures on API requests triggered by internal errors.
341-
pub sync_response_fails: SharedIncMetric,
342-
/// Number of timeouts during communication with the VMM.
343-
pub sync_vmm_send_timeout_count: SharedIncMetric,
344340
}
345341
impl ApiServerMetrics {
346342
/// Const default construction.
347343
pub const fn new() -> Self {
348344
Self {
349345
process_startup_time_us: SharedStoreMetric::new(),
350346
process_startup_time_cpu_us: SharedStoreMetric::new(),
351-
sync_response_fails: SharedIncMetric::new(),
352-
sync_vmm_send_timeout_count: SharedIncMetric::new(),
353347
}
354348
}
355349
}
@@ -497,15 +491,12 @@ impl PatchRequestsMetrics {
497491
pub struct DeprecatedApiMetrics {
498492
/// Total number of calls to deprecated HTTP endpoints.
499493
pub deprecated_http_api_calls: SharedIncMetric,
500-
/// Total number of calls to deprecated CMD line parameters.
501-
pub deprecated_cmd_line_api_calls: SharedIncMetric,
502494
}
503495
impl DeprecatedApiMetrics {
504496
/// Const default construction.
505497
pub const fn new() -> Self {
506498
Self {
507499
deprecated_http_api_calls: SharedIncMetric::new(),
508-
deprecated_cmd_line_api_calls: SharedIncMetric::new(),
509500
}
510501
}
511502
}
@@ -519,8 +510,6 @@ pub struct LoggerSystemMetrics {
519510
pub metrics_fails: SharedIncMetric,
520511
/// Number of misses on logging human readable content.
521512
pub missed_log_count: SharedIncMetric,
522-
/// Number of errors while trying to log human readable content.
523-
pub log_fails: SharedIncMetric,
524513
}
525514
impl LoggerSystemMetrics {
526515
/// Const default construction.
@@ -529,7 +518,6 @@ impl LoggerSystemMetrics {
529518
missed_metrics_count: SharedIncMetric::new(),
530519
metrics_fails: SharedIncMetric::new(),
531520
missed_log_count: SharedIncMetric::new(),
532-
log_fails: SharedIncMetric::new(),
533521
}
534522
}
535523
}
@@ -806,16 +794,13 @@ impl VcpuMetrics {
806794
/// Metrics specific to the machine manager as a whole.
807795
#[derive(Debug, Default, Serialize)]
808796
pub struct VmmMetrics {
809-
/// Number of device related events received for a VM.
810-
pub device_events: SharedIncMetric,
811797
/// Metric for signaling a panic has occurred.
812798
pub panic_count: SharedStoreMetric,
813799
}
814800
impl VmmMetrics {
815801
/// Const default construction.
816802
pub const fn new() -> Self {
817803
Self {
818-
device_events: SharedIncMetric::new(),
819804
panic_count: SharedStoreMetric::new(),
820805
}
821806
}

tests/host_tools/fcmetrics.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def validate_fc_metrics(metrics):
105105
"event_fails",
106106
"rx_queue_event_count",
107107
"rx_event_rate_limiter_count",
108-
"rx_partial_writes",
109108
"rx_rate_limiter_throttled",
110109
"rx_tap_event_count",
111110
"rx_bytes_count",
@@ -119,7 +118,6 @@ def validate_fc_metrics(metrics):
119118
"tx_fails",
120119
"tx_count",
121120
"tx_packets_count",
122-
"tx_partial_reads",
123121
"tx_queue_event_count",
124122
"tx_rate_limiter_event_count",
125123
"tx_rate_limiter_throttled",
@@ -132,8 +130,6 @@ def validate_fc_metrics(metrics):
132130
"api_server": [
133131
"process_startup_time_us",
134132
"process_startup_time_cpu_us",
135-
"sync_response_fails",
136-
"sync_vmm_send_timeout_count",
137133
],
138134
"balloon": [
139135
"activate_fails",
@@ -146,7 +142,6 @@ def validate_fc_metrics(metrics):
146142
"block": block_metrics,
147143
"deprecated_api": [
148144
"deprecated_http_api_calls",
149-
"deprecated_cmd_line_api_calls",
150145
],
151146
"get_api_requests": [
152147
"instance_info_count",
@@ -178,7 +173,6 @@ def validate_fc_metrics(metrics):
178173
"missed_metrics_count",
179174
"metrics_fails",
180175
"missed_log_count",
181-
"log_fails",
182176
],
183177
"mmds": [
184178
"rx_accepted",
@@ -246,7 +240,6 @@ def validate_fc_metrics(metrics):
246240
{"exit_mmio_write_agg": latency_agg_metrics_fields},
247241
],
248242
"vmm": [
249-
"device_events",
250243
"panic_count",
251244
],
252245
"uart": [

tests/integration_tests/functional/test_pause_resume.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def verify_net_emulation_paused(metrics):
1313
"""Verify net emulation is paused based on provided metrics."""
1414
net_metrics = metrics["net"]
1515
assert net_metrics["rx_queue_event_count"] == 0
16-
assert net_metrics["rx_partial_writes"] == 0
1716
assert net_metrics["rx_tap_event_count"] == 0
1817
assert net_metrics["rx_bytes_count"] == 0
1918
assert net_metrics["rx_packets_count"] == 0

0 commit comments

Comments
 (0)