檢視某個程序執行時間的幾種方法
阿新 • • 發佈:2018-11-17
1.首先查出某個程序的pid,然後使用ps命令
[[email protected] ~]# jps 2640 Jps 2339 DataNode 2239 NameNode [[email protected] ~]# ps -p 2239 -o etime ELAPSED 02:47
2.先輸出所有程序的資訊,然後查詢某個程序
[[email protected] ~]# ps -eo etime,cmd | grep NameNode 10:23 /root/softs/jdk1.8.0_172/bin/java -Dproc_namenode -Xmx1000m -Djava.net.preferIPv4Stack=true-Dhadoop.log.dir=/root/softs/hadoop-2.7.3/logs -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/root/softs/hadoop-2.7.3 -Dhadoop.id.str=root -Dhadoop.root.logger=INFO,console -Djava.library.path=/root/softs/hadoop-2.7.3/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Stack=true-Djava.net.preferIPv4Stack=true -Dhadoop.log.dir=/root/softs/hadoop-2.7.3/logs -Dhadoop.log.file=hadoop-root-namenode-hadoop1.log -Dhadoop.home.dir=/root/softs/hadoop-2.7.3 -Dhadoop.id.str=root -Dhadoop.root.logger=INFO,RFA -Djava.library.path=/root/softs/hadoop-2.7.3/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true-Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender -Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender -Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender -Dhadoop.security.logger=INFO,RFAS org.apache.hadoop.hdfs.server.namenode.NameNode