Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <process-state-info.h>
Public Member Functions | |
ProcessStateInfo () | |
string | DebugString () const |
int | GetInt (const string &state_key) const |
int64_t | GetInt64 (const string &state_key) const |
string | GetString (const string &state_key) const |
int64_t | GetBytes (const string &state_key) const |
Original data's unit is B or KB. More... | |
Private Types | |
typedef map< string, string > | ProcessStateMap |
typedef map< int, string > | FileDescriptorMap |
The description info for each file. More... | |
Private Member Functions | |
void | ReadProcIO () |
Read I/O info from /proc/<pid>/io. More... | |
void | ReadProcCgroup () |
Read cgroup info from /proc/<pid>/cgroup. More... | |
void | ReadProcSched () |
Read schedule info from /proc/<pid>/sched. More... | |
void | ReadProcStatus () |
Read status from /proc/<pid>/status. More... | |
void | ReadProcFileDescriptorInfo () |
Read file descriptors belong the process from /proc/<pid>/fd. More... | |
Private Attributes | |
ProcessStateMap | process_state_map_ |
FileDescriptorMap | fd_desc_ |
ProcessStateInfo is an interface to query for process state information at runtime. This contains information about I/O, Cgroup, Scheduler, Process status, as well as the file descriptors that belong to the process. Below are some of the I/O information will be read from /proc/pid/io. io/rchar[int64]: Number of bytes which this task has caused to be read from storage. io/wchar[int64]: Number of bytes which this task has caused to be written to storage. io/syscr[int64]: Number of read I/O operations. io/syscw[int64]: Number of write I/O operations. io/read_bytes[int64]: Number of bytes which this process fetched from storage. io/write_bytes[int64]: Number of bytes which this process wrote to storage. io/cancelled_write_bytes[int64]: Number of bytes which this process did not write, by truncating pagecache. Below are some of the Cgroup information that will be read from /proc/pid/cgroup. cgroup/hierarchy_id[int]: Hierarchy ID number. cgroup/subsystems[string]: Set of subsystems bound to the hierarchy. cgroup/control_group[string]: Control group in the hierarchy to which the process belongs. Below are some of the Scheduler information that will be read from /proc/pid/sched. sched/se.sum_exec_runtime[string]: Sum of execute time. sched/se.statistics.wait_max[string]: Max wait time in ready queue. sched/se.statistics.wait_sum[string]: Sum of wait time in ready queue. sched/se.statistics.wait_count[int64]: Total of wait times. sched/se.statistics.iowait_sum[string]: Sum of wait time for I/O. sched/se.statistics.iowait_count[int64]: Total of wait times for I/O. sched/se.statistics.nr_wakeups_migrate[int64]: Number of wakeups with cpu migration. sched/nr_switches[int64]: Total number of context switches. sched/nr_voluntary_switches[int]: Number of voluntary context switches. sched/nr_involuntary_switches[int]: Number of involuntary context switches. sched/prio[int]: The process priority. Below are some of the Process status information that will be read from /proc/pid/status. status/Threads[int]: Number of threads in process. status/VmPeak[string]: Peak virtual memory size. status/VmSize[string]: Virtual memory size. status/VmLck[string]: Locked memory size. status/VmPin[string]: Pinned memory size. status/VmHWM[string]: Peak resident set size ("high water mark"). status/VmRSS[string]: Resident Set Size. status/VmData[string], status/VmStk[string], status/VmExe[string]: Size of data, stack, and text segments. status/VmLib[string]: Shared library code size. status/VmPTE[string]: Page table entries size (since Linux 2.6.10). status/VmSwap[string]: Swap memory size. status/Cpus_allowed_list[string]: List of CPUs on which this process may run. status/Mems_allowed_list[string]: Memory nodes allowed to this process. File Descriptors information will be read from /proc/pid/fd. The number of files the process has open. The description info for each file.
Definition at line 80 of file process-state-info.h.
|
private |
The description info for each file.
Definition at line 99 of file process-state-info.h.
|
private |
Definition at line 95 of file process-state-info.h.
impala::ProcessStateInfo::ProcessStateInfo | ( | ) |
Read the current process state info when constructed. There is no need to be thread safe.
Definition at line 171 of file process-state-info.cc.
string impala::ProcessStateInfo::DebugString | ( | ) | const |
Definition at line 179 of file process-state-info.cc.
int64_t impala::ProcessStateInfo::GetBytes | ( | const string & | state_key | ) | const |
Original data's unit is B or KB.
Definition at line 65 of file process-state-info.cc.
Referenced by impala::TEST().
int impala::ProcessStateInfo::GetInt | ( | const string & | state_key | ) | const |
Definition at line 42 of file process-state-info.cc.
Referenced by impala::TEST().
int64_t impala::ProcessStateInfo::GetInt64 | ( | const string & | state_key | ) | const |
Definition at line 48 of file process-state-info.cc.
string impala::ProcessStateInfo::GetString | ( | const string & | state_key | ) | const |
Definition at line 59 of file process-state-info.cc.
|
private |
Read cgroup info from /proc/<pid>/cgroup.
Definition at line 98 of file process-state-info.cc.
References path().
|
private |
Read file descriptors belong the process from /proc/<pid>/fd.
Definition at line 150 of file process-state-info.cc.
|
private |
Read I/O info from /proc/<pid>/io.
Definition at line 82 of file process-state-info.cc.
References path().
|
private |
Read schedule info from /proc/<pid>/sched.
Definition at line 116 of file process-state-info.cc.
References path().
|
private |
Read status from /proc/<pid>/status.
Definition at line 133 of file process-state-info.cc.
References path().
|
private |
Definition at line 100 of file process-state-info.h.
|
private |
Definition at line 96 of file process-state-info.h.