Skip to content

Commit 3a06fd3

Browse files
committed
Internal change.
PiperOrigin-RevId: 761600409
1 parent f2d2569 commit 3a06fd3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pkg/sentry/control/control.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ message ControlConfig {
4848
message ContainerStartedEvent {
4949
bool started = 1;
5050
string container_id = 2;
51+
52+
// Logged when the StartContainer request was received.
5153
google.protobuf.Timestamp request_received = 3;
54+
55+
// Logged just before starting the container process.
56+
google.protobuf.Timestamp container_process_starting = 5;
57+
58+
// Logged after the StartContainer request was completed.
5259
google.protobuf.Timestamp request_completed = 4;
5360
}
5461

@@ -57,4 +64,4 @@ message ContainerStartedEvent {
5764
message ContainerExitEvent {
5865
string container_id = 1;
5966
uint32 exit_status = 2;
60-
}
67+
}

pkg/sentry/control/lifecycle.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ func (l *Lifecycle) StartContainer(args *StartContainerArgs, _ *uint32) error {
353353
l.mu.Unlock()
354354

355355
// Start the newly created process.
356+
timeContainerProcessStarting := time.Now()
356357
l.Kernel.StartProcess(tg)
357358
log.Infof("Started the new container %v ", initArgs.ContainerID)
358359

@@ -367,6 +368,10 @@ func (l *Lifecycle) StartContainer(args *StartContainerArgs, _ *uint32) error {
367368
Started: true,
368369
ContainerId: initArgs.ContainerID,
369370
RequestReceived: timeRequestReceived,
371+
ContainerProcessStarting: &timestamppb.Timestamp{
372+
Seconds: timeContainerProcessStarting.Unix(),
373+
Nanos: int32(timeContainerProcessStarting.Nanosecond()),
374+
},
370375
RequestCompleted: &timestamppb.Timestamp{
371376
Seconds: timeRequestCompleted.Unix(),
372377
Nanos: int32(timeRequestCompleted.Nanosecond()),

0 commit comments

Comments
 (0)