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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ and this project adheres to
the UFFD Unix domain socket open to prevent the race condition between the
guest memory mappings message and the shutdown event that was sometimes
causing arrival of an empty message on the UFFD handler side.
- [#5143](https://github.com/firecracker-microvm/firecracker/pull/5143): Fixed
to report `process_startup_time_us` and `process_startup_time_cpu_us` metrics
for `api_server` right after the API server starts, while previously reported
before applying seccomp filter and starting the API server. Users may observe
a bit longer startup time metrics.

## [1.11.0]

Expand Down
11 changes: 6 additions & 5 deletions src/firecracker/src/api_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ impl ApiServer {
// Set the api payload size limit.
server.set_payload_max_size(api_payload_limit);

// Store process start time metric.
process_time_reporter.report_start_time();
// Store process CPU start time metric.
process_time_reporter.report_cpu_start_time();

// Load seccomp filters on the API thread.
// Execution panics if filters cannot be loaded, use --no-seccomp if skipping filters
// altogether is the desired behaviour.
Expand All @@ -86,6 +81,12 @@ impl ApiServer {
}

server.start_server().expect("Cannot start HTTP server");
info!("API server started.");

// Store process start time metric.
process_time_reporter.report_start_time();
// Store process CPU start time metric.
process_time_reporter.report_cpu_start_time();

loop {
let request_vec = match server.requests() {
Expand Down
3 changes: 2 additions & 1 deletion src/firecracker/src/api_server_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use std::thread;

use event_manager::{EventOps, Events, MutEventSubscriber, SubscriberOps};
use vmm::logger::{ProcessTimeReporter, error, warn};
use vmm::logger::{ProcessTimeReporter, error, info, warn};
use vmm::resources::VmResources;
use vmm::rpc_interface::{
ApiRequest, ApiResponse, BuildMicrovmFromRequestsError, PrebootApiController,
Expand Down Expand Up @@ -175,6 +175,7 @@
return Err(ApiServerError::FailedToBindAndRunHttpServer(err));
}
};
info!("Listening on API socket ({bind_path:?}).");

Check warning on line 178 in src/firecracker/src/api_server_adapter.rs

View check run for this annotation

Codecov / codecov/patch

src/firecracker/src/api_server_adapter.rs#L178

Added line #L178 was not covered by tests

let api_kill_switch_clone = api_kill_switch
.try_clone()
Expand Down