|
|
@@ -0,0 +1,43 @@
|
|
|
+package cn.reghao.autodop.dmaster.monitor.controller;
|
|
|
+
|
|
|
+import cn.reghao.autodop.common.jvm.pojo.JvmInfo;
|
|
|
+import cn.reghao.autodop.common.jvm.pojo.JvmStat;
|
|
|
+import cn.reghao.autodop.dmaster.monitor.service.JvmMonitorService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author reghao
|
|
|
+ * @date 2019-11-15 08:44:50
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@Api(tags = "JVM 监控页面")
|
|
|
+@Controller
|
|
|
+@RequestMapping("/monitor/jvm")
|
|
|
+public class JvmPageController {
|
|
|
+ private JvmMonitorService jvmMonitorService;
|
|
|
+
|
|
|
+ public JvmPageController(JvmMonitorService jvmMonitorService) {
|
|
|
+ this.jvmMonitorService = jvmMonitorService;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "JVM 信息页面")
|
|
|
+ @GetMapping("/info")
|
|
|
+ public String jvmInfo(Model model) {
|
|
|
+ JvmInfo jvmInfo = jvmMonitorService.jvmInfo();
|
|
|
+ model.addAttribute("jvmInfo", jvmInfo);
|
|
|
+ return "/monitor/jvminfo";
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "JVM 状态页面")
|
|
|
+ @GetMapping("/stat")
|
|
|
+ public String jvmStat(Model model) {
|
|
|
+ JvmStat jvmStat = jvmMonitorService.jvmStat();
|
|
|
+ model.addAttribute("jvmStat", jvmStat);
|
|
|
+ return "/monitor/jvmstat";
|
|
|
+ }
|
|
|
+}
|