Commit 296d6396 by wuchengwu

我的设备管理:新增设备时耗时监控

parent cb6bcb4d
......@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
......@@ -181,9 +182,16 @@ public class SysClientVpController {
@GetMapping("/newSheb")
public String newSheb(HttpServletRequest request, HttpServletResponse response, Model model) {
try {
StopWatch stopWatch = new StopWatch();
stopWatch.start("获取本地ip耗时:");
String ip = SysUitl.getIp(request);
stopWatch.stop();
stopWatch.start("获取本地mac地址耗时:");
String mac = SysUitl.getkhdMac(ip);
stopWatch.stop();
System.out.println("本地ip与mac耗时百分比:"+stopWatch.prettyPrint());
model.addAttribute("sip", ip);
model.addAttribute("mac", SysUitl.getkhdMac(ip));
model.addAttribute("mac",mac );
} catch (Exception e) {
e.printStackTrace();
}
......
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