0.34.6_repo_cleanup

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 09:31:15 +02:00
1 parent ce1a90397c
commit 133d2f0f91
273 files changed
+5969 -6926

No files matched your search

@@ -220,9 +220,6 @@ pub(crate) fn augment(view: &mut View) {
)
.filter(|count| *count > 0);
}
// Linux-specific augmentation preserves fields and units that existed before
// the cross-platform library adapter. LXC additionally overrides uptime/load
// with namespace-visible data so the dashboard does not report the host values.
if environment == LinuxEnvironment::Lxc {
if let Some(uptime) = lxc_uptime_seconds() {
view.system_uptime_seconds = Some(uptime);
@@ -277,4 +274,4 @@ pub(crate) fn augment(view: &mut View) {
}
#[cfg(test)]
include!("linux/tests.rs");
include!("tests.rs");
-23
View File
@@ -1,11 +1,3 @@
//! Cross-platform system/process statistics used by low-frequency diagnostics.
//!
//! Generic host metrics come from `systemstat`, network inventory/counters use
//! `sysinfo`, and generic process metrics use `metrics-process` where supported.
//! `systemstat` is also a library-level network fallback on targets where
//! `sysinfo` has no native network backend. Platform-specific
//! code is limited to additive metrics that the common libraries do not expose.
//! Missing metrics stay `None`; callers must not synthesize values.
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
@@ -35,15 +27,10 @@ pub struct View {
pub process_virtual_memory_bytes: Option<u64>,
pub process_virtual_memory_max_bytes: Option<u64>,
pub process_start_time_seconds: Option<u64>,
/// Resident anonymous memory (heap/stacks/private anonymous mappings).
pub process_rss_anon_bytes: Option<u64>,
/// Resident file-backed mappings.
pub process_rss_file_bytes: Option<u64>,
/// Resident shared-memory mappings.
pub process_rss_shmem_bytes: Option<u64>,
/// Data/heap virtual address space reported by the native platform source.
pub process_data_bytes: Option<u64>,
/// Process swap currently charged by the kernel.
pub process_swap_bytes: Option<u64>,
pub open_fds: Option<usize>,
pub max_fds: Option<u64>,
@@ -289,9 +276,6 @@ fn merge_network_interfaces(
primary: Vec<NetworkInterfaceView>,
secondary: Vec<NetworkInterfaceView>,
) -> Vec<NetworkInterfaceView> {
// Both libraries expose cumulative byte counters. Merge by interface name
// and keep the larger counter so a partial/zero reading from one backend
// cannot hide a usable reading from the other.
normalize_network_interfaces(
primary
.into_iter()
@@ -301,11 +285,6 @@ fn merge_network_interfaces(
}
fn collect_network(view: &mut View) {
// `sysinfo::Networks` is the primary interface/traffic API. `systemstat`
// supplements it and is the library-level fallback on targets where
// sysinfo has no native network backend. Combining both inventories also
// avoids dropping an interface when either backend is only partially
// available. No shell commands or per-platform network parser are used.
let interfaces =
merge_network_interfaces(collect_network_sysinfo(), collect_network_systemstat());
if interfaces.is_empty() {
@@ -391,8 +370,6 @@ pub(crate) fn sample(previous: Option<(View, Counters)>) -> (View, Counters) {
collect_network(&mut view);
// Preserve the existing detailed Linux fields and Linux memory-used semantics;
// these are additive details not provided by the common libraries.
#[cfg(target_os = "linux")]
linux::augment(&mut view);