Skip to content

Use os proc stat to fetch processStatTime for a PID instead of TaskstastsPID - #377

Merged
def merged 3 commits into
coroot:mainfrom
vishnukumarkvs:use-osstat-for-processstarttime
Sep 30, 2026
Merged

def merged 3 commits into
coroot:mainfrom
vishnukumarkvs:use-osstat-for-processstarttime

Conversation

@vishnukumarkvs

Copy link
Copy Markdown
Contributor

Fixes: #376

This will move away from Kernel call to fetch process start time. Instead, it uses /proc/pid/stat for the same functionality

Comment thread proc/proc.go Outdated
if err != nil {
return time.Time{}
}
btime, err := bootTime()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there’s no need to read the boot time on every call. We can simply cache it in a global variable since it never changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, updated in latest commit

@def
def force-pushed the use-osstat-for-processstarttime branch from 46889d5 to a9fd101 Compare September 30, 2026 17:34
@def
def merged commit 91a1940 into coroot:main Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node Agent triggered Kernel Panic when querying for TaskStats details

2 participants