Merge branch 'master' into dev

Conflicts:
	.gitignore
This commit is contained in:
fangshunjian
2019-01-11 10:51:10 +06:00
3 changed files with 9 additions and 4 deletions

4
.gitignore vendored
View File

@@ -1 +1,5 @@
<<<<<<< HEAD
/bin /bin
=======
/bin/
>>>>>>> refs/heads/master

View File

@@ -1156,8 +1156,7 @@ public class ProcessUtil
*/ */
public static List<String> getLinuxProcessId(String procSearchKey) public static List<String> getLinuxProcessId(String procSearchKey)
{ {
String cmd = "ps -ef | grep -i '" + procSearchKey.trim() String cmd = "ps -ef | grep " + procSearchKey.trim() + " | grep -v grep | awk '{print $2}'";
+ "' | grep -v grep | awk '{print $2}'";
logger.info("getLinuxProcessId-----" + cmd); logger.info("getLinuxProcessId-----" + cmd);
String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd }; String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd };
BufferedReader bReader = null; BufferedReader bReader = null;

View File

@@ -190,8 +190,10 @@ public class SystemInfo
// a)物理内存信息 // a)物理内存信息
Mem mem = sigar.getMem(); Mem mem = sigar.getMem();
Long memTotal = mem.getTotal();// 内存总量 Long memTotal = mem.getTotal();// 内存总量
Long memUsed = mem.getUsed();// 当前内存使用量 //Long memUsed = mem.getUsed();// 当前内存使用量
Long memFree = mem.getFree();// 当前内存剩余量 //Long memFree = mem.getFree();// 当前内存剩余量
Long memFree = mem.getActualFree();//
Long memUsed = mem.getActualUsed();
sb.append(doubleFormat(memTotal / (1024 * 1024 * 1024.0), 2));// 内存总量,单位:"G" sb.append(doubleFormat(memTotal / (1024 * 1024 * 1024.0), 2));// 内存总量,单位:"G"
sb.append(SEPARATOR); sb.append(SEPARATOR);
sb.append(doubleFormat(memUsed / (1024 * 1024 * 1024.0), 2));// 当前内存使用量,单位:"G" sb.append(doubleFormat(memUsed / (1024 * 1024 * 1024.0), 2));// 当前内存使用量,单位:"G"