瀏覽代碼

BuildLog 中添加一个 pushTotalTime 字段, 推送构建包到服务器需要的时间

reghao 4 年之前
父節點
當前提交
08f2cde628

+ 1 - 0
dmaster/src/main/java/cn/reghao/autodop/dmaster/app/model/po/log/BuildTime.java

@@ -14,5 +14,6 @@ public class BuildTime {
     private Long updateTotalTime;
     private Long compileTotalTime;
     private Long packTotalTime;
+    private Long pushTotalTime;
     private LocalDateTime buildTime;
 }

+ 4 - 1
dmaster/src/main/java/cn/reghao/autodop/dmaster/app/service/AppBuildSupplier.java

@@ -38,9 +38,12 @@ public class AppBuildSupplier implements Supplier<BuildLog> {
 
             start = System.currentTimeMillis();
             String localPath = appBuilder.pack();
+            buildLog.getBuildTime().setPackTotalTime(System.currentTimeMillis()-start);
+
+            start = System.currentTimeMillis();
             String packagePath = appBuilder.push(localPath);
             buildLog.setPackagePath(packagePath);
-            buildLog.getBuildTime().setPackTotalTime(System.currentTimeMillis()-start);
+            buildLog.getBuildTime().setPushTotalTime(System.currentTimeMillis()-start);
         } catch (Exception e) {
             buildException(buildLog, e);
             return buildLog;

+ 6 - 0
dmaster/src/main/java/cn/reghao/autodop/dmaster/sys/controller/SysPageController.java

@@ -53,4 +53,10 @@ public class SysPageController {
         model.addAttribute("jvmStat", jvmStat);
         return "/sys/jvmstatus";
     }
+
+    @ApiOperation(value = "dmaster 日志页面")
+    @GetMapping("/dmasterlog/{machineId}")
+    public String dmasterlogPage(@PathVariable("machineId") String machineId, Model model) {
+        return "/sys/jvmstatus";
+    }
 }

+ 2 - 0
dmaster/src/main/resources/templates/app/bd/log/buildtime.html

@@ -9,6 +9,7 @@
             <th class="sortable" data-field="updateTotalTime">更新耗时(ms)</th>
             <th class="sortable" data-field="compileTotalTime">编译耗时(ms)</th>
             <th class="sortable" data-field="packTotalTime">打包耗时(ms)</th>
+            <th class="sortable" data-field="pushTotalTime">推送耗时(ms)</th>
         </tr>
         </thead>
         <tbody>
@@ -16,6 +17,7 @@
             <td th:text="${buildTime.updateTotalTime}">更新耗时</td>
             <td th:text="${buildTime.compileTotalTime}">编译耗时</td>
             <td th:text="${buildTime.packTotalTime}">打包耗时</td>
+            <td th:text="${buildTime.pushTotalTime}">推送耗时</td>
         </tr>
         </tbody>
     </table>