rkt: show created/started times in rkt list/status #2030
Conversation
err error | ||
) | ||
if p.isRunning() || p.afterRun() { | ||
t, err = p.getModTime("ppid") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, stage1 implementations have the choice to write either the "ppid" or the "pid. Then, stage0's getContainerPID1() is able to read either file: it tries "pid" and if it does not work, fall back on "ppid".
The two files are documented in the Stage 1 ACI implementor's guide.
To be consistent, getStartTime() should check "pid" too, although it is not very useful since it is not written in the current implementation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
|
97cc07f
to
f013858
Compare
|
||
created, err := p.getCreationTime() | ||
if err != nil { | ||
errors = append(errors, fmt.Errorf("unable to get creation time for pod %q: %v", uuid, err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moar work for @chris' structured error work.
I'm a bit uneasy about the functional test - it might fail under a load. Otherwise LFAD. |
What do you mean? Why do you think it might fail? |
|
||
#### New features and UX changes | ||
|
||
- Add pod creation and start times to `rkt list` and `rkt status` ([#2030](https://github.com/coreos/rkt/pull/2030)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to list.md as well?
You are basically running rkt and getting a timestamp. If machine is under the load, then the time between the two might be longer than the delta we tolerate. Is is probably just my paranoia and is highly unlikely, because a second is a lot of time. If it start failing in semaphore we can always make the delta larger. |
To get the pod creation time we use the modification time in `/var/lib/rkt/pods/*/<UUID>/pod`. It's written when the pod is prepared and doesn't change afterwards. To get the pod start time we use the modification time in `/var/lib/rkt/pods/*/<UUID>/ppid`. It's written when the pod actually starts and doesn't change afterwards.
cd13cf4
to
0b034d6
Compare
Updated. Let's revisit if we have problems with the tests. |
rkt: show created/started times in rkt list/status
To get the pod creation time we use the modification time in
/var/lib/rkt/pods/*/<UUID>/pod
. It's written when the pod is preparedand doesn't change afterwards.
To get the pod start time we use the modification time in
/var/lib/rkt/pods/*/<UUID>/ppid
. It's written when the pod actuallystarts and doesn't change afterwards.
Partially addresses #1789