impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabor Kaszab (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5511: Add process start time to debug web page
Date Mon, 10 Jul 2017 07:19:34 GMT
Gabor Kaszab has posted comments on this change.

Change subject: IMPALA-5511: Add process start time to debug web page
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7363/1/be/src/util/process-state-info.cc
File be/src/util/process-state-info.cc:

PS1, Line 176:  /proc/$0/
> Is the ctime of this directory documented to be the process start time?
Good point.
After some research it seems that making 'stat' on the /proc/ directory entries is not the
reliable way of checking the start time as they might be updated after startup (even the ctime).
I guess using stat() would result the same issue here.

I found 2 solutions:
1) Invoking "ps -o lstart --pid <pid>" via command line
2) There is tricky solution mentioned here in the second comment:
https://stackoverflow.com/questions/6514378/how-do-you-get-how-long-a-process-has-been-running?rq=1
Basically, you can get theprocess_start_time from /proc/<pid>/stat (22nd value), but
that is the time difference between system boot and process start. In order to get the desired
start_time you have to get the boot_time from /proc/uptime and using the current time you
can calculate it from these.

I would vote for 1)
What do you think?


-- 
To view, visit http://gerrit.cloudera.org:8080/7363
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I05ae2f80835b1b0e4bc3b38731778ba0871338a4
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Gabor Kaszab <gaborkaszab@cloudera.com>
Gerrit-Reviewer: Attila Jeges <attilaj@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Gabor Kaszab <gaborkaszab@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Laszlo Gaal <laszlo.gaal@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message