kongdeqiang
2026-04-13 e7d90fd46364afb25c9c0cb9c1a5784f7aac6bf9
src/main/java/com/wgcloud/util/PingUtil.java
@@ -37,10 +37,11 @@
        String pingCommand;
        Runtime r = Runtime.getRuntime();
        String osName = System.getProperty("os.name");
        System.out.println( "osName:"+osName);
        if (osName.contains("Windows")) {
            pingCommand = "ping " + ipAddress + " -n " + count + " -w " + (timeOut * 1000);
        } else {
            pingCommand = "ping " + " -c " + count + " -w " + timeOut + " " + ipAddress;
            pingCommand = "ping " + " -c " + count +  " "  + ipAddress;
        }
        Integer diffTimes = StaticKeys.OUT_TIME_MARK;
        try {
@@ -87,6 +88,7 @@
            //查找整数的正则 begin
            String regInt = "(=\\d+ms)";
            Pattern patternInt = Pattern.compile(regInt);
            Matcher matcherInt = patternInt.matcher(line);
            while (matcherInt.find()) {
                String groupStr = matcherInt.group(1);
@@ -105,6 +107,7 @@
            String regDouble = "(=\\d+.\\d+ms)";
            Pattern patternDouble = Pattern.compile(regDouble);
            Matcher matcherDouble = patternDouble.matcher(line);
            while (matcherDouble.find()) {
                String groupStr = matcherDouble.group(1);
                logger.debug(line + "--------------" + groupStr);