Explorar o código

增加流媒体调用时间日志

gao.qiang hai 9 meses
pai
achega
ff6dd971d8

+ 6 - 1
business-service/src/main/java/com/ozs/utils/CameraUtil.java

@@ -1307,9 +1307,14 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
             log.info("urls----->" + urls);
             try {
                 log.info("httpUrl---------->" + url + "/rtsp/api/pull?target=" + urls + "&streamPath=" + camerasVo.getCameraIndexCode() + "/" + channel + "&save=0");
+                long begin = System.currentTimeMillis();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+                log.info("流媒体开始调用: " + sdf.format(new Date(begin)));
                 String msg = HttpUtils.sendGet(url + "/rtsp/api/pull?target=" + urls + "&streamPath=" + camerasVo.getCameraIndexCode() + "/" + channel + "&save=0");
+                long end = System.currentTimeMillis();
+                log.info("流媒体结束调用: " + sdf.format(new Date(end)));
+                log.info("流媒体请求用时时间:" + (end - begin) + "毫秒");
                 log.info("msg---------->" + msg);
-                log.info("boolen--------------" + msg.contains("ok"));
                 if (!msg.contains("ok")) {
                     return "暂无视频-" + camerasVo.getCameraIndexCode();
                 }