Commit e1ce5d2d authored by 李贺's avatar 李贺

更新进程采集

parent 3db1b9b0
...@@ -43,6 +43,7 @@ def get_all_mountpoint(): ...@@ -43,6 +43,7 @@ def get_all_mountpoint():
if __name__ == "__main__": if __name__ == "__main__":
processList=get_all_mountpoint() processList=get_all_mountpoint()
for process in sorted(processList,key=lambda x:x[3],reverse=True)[:5]: #取Memory前5 for process in sorted(processList,key=lambda x:x[3],reverse=True)[:5]: #取Memory前5
if process[3]<=0:break
tmp_memory_percent={ tmp_memory_percent={
"endpoint":endpoint, "endpoint":endpoint,
"tags":"pid="+process[1]+",cmd="+process[6], "tags":"pid="+process[1]+",cmd="+process[6],
...@@ -54,6 +55,7 @@ if __name__ == "__main__": ...@@ -54,6 +55,7 @@ if __name__ == "__main__":
} }
data.append(tmp_memory_percent) data.append(tmp_memory_percent)
for process in sorted(processList,key=lambda x:x[2],reverse=True)[:5]: #取CPU前5 for process in sorted(processList,key=lambda x:x[2],reverse=True)[:5]: #取CPU前5
if process[2]<=0:break
tmp_cpu_percent={ tmp_cpu_percent={
"endpoint":endpoint, "endpoint":endpoint,
"tags":"pid="+process[1]+",cmd="+process[6], "tags":"pid="+process[1]+",cmd="+process[6],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment