Class MvcController
java.lang.Object
com.nmontytskyi.monitoring.server.web.MvcController
Spring MVC controller that serves the server-side rendered Thymeleaf pages.
Each handler method populates a Model with the data
required by the corresponding template and returns the template name. Page data is
loaded eagerly on the initial HTTP GET; charts and live metrics are subsequently
updated by JavaScript polling of the REST API.
- Author:
- Nazar Montytskyi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalerts(org.springframework.ui.Model model) createAlertRule(Long serviceId, String metricType, String comparator, Double threshold, int cooldownMinutes, boolean enabled, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) dashboard(org.springframework.ui.Model model) deleteAlertRule(Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) deleteService(Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) runRetentionNow(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) saveDashboard(String refreshSeconds, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) saveEmail(String emailTo, String emailEnabled, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) saveRetention(String retentionEnabled, String metricDays, String alertDays, String reportDays, String retentionFrequency, String retentionTime, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) saveSla(Long serviceId, double uptimePercent, long maxResponseTimeMs, double maxErrorRatePercent, String description, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) serviceDetail(Long id, org.springframework.ui.Model model) settings(org.springframework.ui.Model model)
-
Constructor Details
-
MvcController
public MvcController()
-
-
Method Details
-
dashboard
-
serviceDetail
-
slaReport
-
reports
-
alerts
-
createAlertRule
@PostMapping("/alerts/rules") public String createAlertRule(@RequestParam Long serviceId, @RequestParam String metricType, @RequestParam String comparator, @RequestParam Double threshold, @RequestParam(defaultValue="15") int cooldownMinutes, @RequestParam(required=false,defaultValue="false") boolean enabled, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) -
deleteService
-
deleteAlertRule
-
settings
-
saveDashboard
-
saveEmail
-
saveRetention
@PostMapping("/settings/retention") public String saveRetention(@RequestParam String retentionEnabled, @RequestParam String metricDays, @RequestParam String alertDays, @RequestParam String reportDays, @RequestParam String retentionFrequency, @RequestParam String retentionTime, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) -
runRetentionNow
@PostMapping("/settings/retention/run") public String runRetentionNow(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) -
saveSla
@PostMapping("/settings/sla/{serviceId}") public String saveSla(@PathVariable Long serviceId, @RequestParam double uptimePercent, @RequestParam long maxResponseTimeMs, @RequestParam double maxErrorRatePercent, @RequestParam(required=false) String description, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) -
handleNotFound
@ExceptionHandler(ServiceNotFoundException.class) @ResponseStatus(NOT_FOUND) public String handleNotFound()
-