-
Notifications
You must be signed in to change notification settings - Fork 55
Incorrect elapsed time reported on Docker #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! Really detailed bug report, thanks for that! So, the value we call
Source: My guess is that we forgot to substract the system uptime to get a value representing "ms since the start of the process" (quoted above). |
Heya, thanks for getting back to me on this! The system uptime is stored in I tried logging that just before the
and got
The last pair has a difference of 3080 ms between them. That's kinda odd, because it's roughly how long the test lasts. But this docker machine has been up for longer than that. Is
This in turn gives me the numbers I expected for
Timestamp is still very small though. Looking at the If I change that now:
I get similar numbers on windows and linux:
What do you think? I'll make a PR with these changes. |
Here is the PR #83 |
Definitely! About the Tyvm for taking care of this! |
Regarding On Windows that's the number used for If we could get the time since epoch of the procfile process proper that would be more precise. I can't see it listed in http://man7.org/linux/man-pages/man5/proc.5.html though. |
Heya, I've noticed some odd elapsed time reported on Docker images. I'm not too sure if it's docker or linux or generally, but my machine is Windows and I see the issue when using Docker. I also see it happening on CircleCI, and they use docker images for their CI machines.
Here's repro: https://github.com/filipesilva/pidusage-docker. It's just a test script that print stats three times on
npm test
:On my Windows machine I see something like this:
Using one of CircleCI's docker images, for instance
circleci/node:8.11-browsers
, I see the following(NB: d:/sandbox:/sandbox is just mounting my local folder so I don't have to git clone the repro)
The difference between each
elapsed
seems correct, but they are reporting something like 48 years of elapsed time.I guess it's related with the extremely low
timestamp
though, sinceelapsed
is calculated from it:https://github.com/soyuka/pidusage/blob/master/lib/procfile.js#L115-L116
I tried adding some logging to the relevant computations for the timestamp:
Looking at the calculated numbers it doesn't seem like anything is going wrong, just that
starttime
from the procfile looks really small.Happy to try and fix this, do you have any ideas on how to proceed?
The text was updated successfully, but these errors were encountered: