Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
作用
新增进程采集器ProcessCollector
新增指标
系统级别
vm_process_minimum: 多值体系下的系统内进程数最小值
vm_process_maximum: 多值体系下的系统内进程数最大值
vm_process_average: 多值体系下的系统内进程数平均值
vm_process:系统内进程数,pid数
进程级别
process_cpu_average: 多值体系下的某个进程的cpu利用率平均值
process_memory_average: 多值体系下的某个进程的内存利用率平均值
process_openfile_average: 多值体系下的某个进程的打开文件数的平均值
process_number_average : 多值体系下的某个进程的线程数平均值
process_number_maximum: 多值体系下的某个进程的线程数最大值
process_number_minimum : 多值体系下的某个进程的线程数最小值
process_expand封装
process_expand_cpu_percent: process_expand 封装,某个进程的CPU利用率
process_expand_memory_percent: process_expand封装,某个进程的内存利用率
process_expand_openfile_number:process_expand封装,某个进程的打开文件数
tag:
name:进程名
user: 进程用户
path:进程所在路径
args:运行参数
指标计算方法
CPU利用率
通过解析/proc/pid/status文件,解析cutime,cstime,utime,stime
user = utime + cutime
sys = stime + cstime
totalTime = user + sys
pid_cpu_percent = totcalCPUDiff/timeDiff;
totcalCPUDiff = (this_cpu_total - prev_cpu_total)/ hz
timeDiff = (本次采样时间-上次采样时间)
内存利用率
解析/proc/pid/statm
Resident = statm_resident * pagesize
pid_mem_percent = Resident / totalMemory
文件数
检查/proc/pid/fd
找出fd文件夹,计数