Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bottlecap/src/proc/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub const PROC_UPTIME_PATH: &str = "/proc/uptime";
pub const PROC_PATH: &str = "/proc";
pub const ETC_PATH: &str = "/etc";

pub const LAMDBA_NETWORK_INTERFACE: &str = "vinternal_1";
pub const LAMBDA_NETWORK_INTERFACE: &str = "vinternal_1";
pub const LAMBDA_RUNTIME_NETWORK_INTERFACE: &str = "vint_runtime";
pub const LAMBDA_FILE_DESCRIPTORS_DEFAULT_LIMIT: f64 = 1024.0;
pub const LAMBDA_EXECUTION_PROCESSES_DEFAULT_LIMIT: f64 = 1024.0;
6 changes: 4 additions & 2 deletions bottlecap/src/proc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use std::{
};

use constants::{
LAMDBA_NETWORK_INTERFACE, PROC_NET_DEV_PATH, PROC_PATH, PROC_STAT_PATH, PROC_UPTIME_PATH,
LAMBDA_NETWORK_INTERFACE, LAMBDA_RUNTIME_NETWORK_INTERFACE, PROC_NET_DEV_PATH, PROC_PATH,
PROC_STAT_PATH, PROC_UPTIME_PATH,
};
use regex::Regex;
use tracing::{debug, trace};
Expand Down Expand Up @@ -60,7 +61,8 @@ fn get_network_data_from_path(path: &str) -> Result<NetworkData, io::Error> {
let mut values = line.split_whitespace();

if values.next().map_or(false, |interface_name| {
interface_name.starts_with(LAMDBA_NETWORK_INTERFACE)
interface_name.starts_with(LAMBDA_NETWORK_INTERFACE)
|| interface_name.starts_with(LAMBDA_RUNTIME_NETWORK_INTERFACE)
}) {
// Read the value for received bytes if present
let rx_bytes: Option<f64> = values.next().and_then(|s| s.parse().ok());
Expand Down
Loading