Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.
This repository was archived by the owner on May 1, 2023. It is now read-only.

Meaning of CPU time in ProcessCounters #73

@amanjeetsingh150

Description

@amanjeetsingh150

Hey,

I am trying to understand why the CPU time is inferred as the sum of user time and system time through getrusage here in ProcessCounters.cpp .

CPU time of process to me is the time when the process is executing instructions on CPU and is not idle. Ideally, the code should not include the time when the CPU is idle due to waiting on I/O or due to lock.

Resources: http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html

I ran an experiment reading large CSV files which is an IO-bound task (CMIIW) and this number (rusageStats.ru_utime + rusageStats.ru_stime) starts incrementing quickly and according to the definition, it should not grow with quickly large numbers as the CPU will be idle for this process.

Can you suggest some experiments which I can run on my emulators or device to validate that this time will not increment if I keep my CPU idle or stalled due to some external resource?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions