Skip to content

Commit

Permalink
Migrate procfs memory module under procfs/
Browse files Browse the repository at this point in the history
In practice the `memory.rs` is only used by the procfs sampler. This
commit migrates the code to match its use.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
  • Loading branch information
blt committed Dec 5, 2024
1 parent 67078d8 commit 32ffba5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions lading/src/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ use serde::Deserialize;
#[cfg(target_os = "linux")]
mod linux;

#[cfg(target_os = "linux")]
mod memory;

#[allow(dead_code)] // used on Linux
/// Expose the process' current RSS consumption, allowing abstractions to be
/// built on top in the Target implementation.
Expand Down
4 changes: 3 additions & 1 deletion lading/src/observer/linux/procfs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// Sampler implementation for procfs filesystems
mod memory;

use std::{collections::VecDeque, io, sync::atomic::Ordering};

use metrics::gauge;
Expand All @@ -8,8 +10,8 @@ use procfs::{process::Process, Current};
use rustc_hash::{FxHashMap, FxHashSet};
use tracing::{error, warn};

use crate::observer::memory::{Regions, Rollup};
use crate::observer::RSS_BYTES;
use memory::{Regions, Rollup};

const BYTES_PER_KIBIBYTE: u64 = 1024;

Expand Down
File renamed without changes.

0 comments on commit 32ffba5

Please sign in to comment.