Skip to content

Commit 8ce1360

Browse files
zulinx86roypat
authored andcommitted
fix(vmm): Emit startup metrics after server start
api_server.process_startup_time_us and process_startup_time_cpu_us should be reported right after the server starts. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent becefb2 commit 8ce1360

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ and this project adheres to
4848
the UFFD Unix domain socket open to prevent the race condition between the
4949
guest memory mappings message and the shutdown event that was sometimes
5050
causing arrival of an empty message on the UFFD handler side.
51+
- [#5143](https://github.com/firecracker-microvm/firecracker/pull/5143): Fixed
52+
to report `process_startup_time_us` and `process_startup_time_cpu_us` metrics
53+
for `api_server` right after the API server starts, while previously reported
54+
before applying seccomp filter and starting the API server. Users may observe
55+
a bit longer startup time metrics.
5156

5257
## [1.11.0]
5358

src/firecracker/src/api_server/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ impl ApiServer {
7070
// Set the api payload size limit.
7171
server.set_payload_max_size(api_payload_limit);
7272

73-
// Store process start time metric.
74-
process_time_reporter.report_start_time();
75-
// Store process CPU start time metric.
76-
process_time_reporter.report_cpu_start_time();
77-
7873
// Load seccomp filters on the API thread.
7974
// Execution panics if filters cannot be loaded, use --no-seccomp if skipping filters
8075
// altogether is the desired behaviour.
@@ -88,6 +83,11 @@ impl ApiServer {
8883
server.start_server().expect("Cannot start HTTP server");
8984
info!("API server started.");
9085

86+
// Store process start time metric.
87+
process_time_reporter.report_start_time();
88+
// Store process CPU start time metric.
89+
process_time_reporter.report_cpu_start_time();
90+
9191
loop {
9292
let request_vec = match server.requests() {
9393
Ok(vec) => vec,

0 commit comments

Comments
 (0)