Skip to content

Commit

Permalink
Fix swapped node vs. v8 modules for push_config log (#23942)
Browse files Browse the repository at this point in the history
*

GitOrigin-RevId: 93bf5a2250043a16e28baead92ad14efd89c7258
  • Loading branch information
sshader authored and Convex, Inc. committed Mar 26, 2024
1 parent 831f54f commit 848fa0d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crates/local_backend/src/deploy_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,16 @@ pub struct ConfigJson {
pub bundled_module_infos: Option<Vec<BundledModuleInfoJson>>,
}

pub struct ConfigStats {
pub num_node_modules: usize,
pub size_node_modules: usize,
pub num_v8_modules: usize,
pub size_v8_modules: usize,
}

static NODE_ENVIRONMENT: &str = "node";
impl ConfigJson {
pub fn stats(&self) -> (usize, usize, usize, usize) {
pub fn stats(&self) -> ConfigStats {
let num_node_modules = self
.modules
.iter()
Expand All @@ -175,12 +182,12 @@ impl ConfigJson {
.iter()
.filter(|module| module.environment.as_deref() != Some(NODE_ENVIRONMENT))
.count();
(
ConfigStats {
num_v8_modules,
num_node_modules,
size_v8_modules,
size_node_modules,
)
}
}
}

Expand Down

0 comments on commit 848fa0d

Please sign in to comment.