diff --git a/compute_tools/src/compute.rs b/compute_tools/src/compute.rs index 70d83a7b47..aec4e49725 100644 --- a/compute_tools/src/compute.rs +++ b/compute_tools/src/compute.rs @@ -516,9 +516,9 @@ impl ComputeNode { self.prepare_pgdata(&compute_state)?; let start_time = Utc::now(); - let pg = self.start_postgres(pspec.storage_auth_token.clone())?; + let config_time = Utc::now(); if pspec.spec.mode == ComputeMode::Primary && !pspec.spec.skip_pg_catalog_updates { self.apply_config(&compute_state)?; } @@ -526,11 +526,16 @@ impl ComputeNode { let startup_end_time = Utc::now(); { let mut state = self.state.lock().unwrap(); - state.metrics.config_ms = startup_end_time + state.metrics.start_postgres_ms = config_time .signed_duration_since(start_time) .to_std() .unwrap() .as_millis() as u64; + state.metrics.config_ms = startup_end_time + .signed_duration_since(config_time) + .to_std() + .unwrap() + .as_millis() as u64; state.metrics.total_startup_ms = startup_end_time .signed_duration_since(compute_state.start_time) .to_std() diff --git a/libs/compute_api/src/responses.rs b/libs/compute_api/src/responses.rs index ce73dda08a..80e5341216 100644 --- a/libs/compute_api/src/responses.rs +++ b/libs/compute_api/src/responses.rs @@ -71,6 +71,7 @@ pub struct ComputeMetrics { pub wait_for_spec_ms: u64, pub sync_safekeepers_ms: u64, pub basebackup_ms: u64, + pub start_postgres_ms: u64, pub config_ms: u64, pub total_startup_ms: u64, } diff --git a/test_runner/performance/test_startup.py b/test_runner/performance/test_startup.py index 8babbbe132..4744c1ed2e 100644 --- a/test_runner/performance/test_startup.py +++ b/test_runner/performance/test_startup.py @@ -52,6 +52,7 @@ def test_startup_simple(neon_env_builder: NeonEnvBuilder, zenbenchmark: NeonBenc "wait_for_spec_ms": f"{i}_wait_for_spec", "sync_safekeepers_ms": f"{i}_sync_safekeepers", "basebackup_ms": f"{i}_basebackup", + "start_postgres_ms": f"{i}_start_postgres", "config_ms": f"{i}_config", "total_startup_ms": f"{i}_total_startup", }