You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/04/20 13:38:26 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #2639: Add debug page on Monitor

ctubbsii commented on code in PR #2639:
URL: https://github.com/apache/accumulo/pull/2639#discussion_r854142311


##########
server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java:
##########
@@ -446,4 +446,49 @@ public Map<String,Object> getReplication() {
 
     return model;
   }
+
+  @GET
+  @Path("all")
+  @Template(name = "/default.ftl")
+  public Map<String,Object> getRestView() {
+
+    Map<String,Object> model = getModel();
+    model.put("title", "Rest Endpoints");
+
+    model.put("template", "debug.ftl");
+    model.put("js", "functions.js");
+
+    model.put("endpoints", getEndpoints());
+
+    return model;
+  }
+
+  private List<String> getEndpoints() {
+    List<String> endpoints = new ArrayList<>();
+    endpoints.add("/rest/manager");
+    endpoints.add("/rest/tables/namespaces");
+    endpoints.add("/rest/problems/summary");
+    endpoints.add("/rest/tables");
+    endpoints.add("/rest/tservers");
+    endpoints.add("/rest/scans");
+    endpoints.add("/rest/bulkImports");
+    endpoints.add("/rest/tservers/serverStats");
+    endpoints.add("/rest/tservers/recovery");
+    endpoints.add("/rest/logs");
+    endpoints.add("/rest/problems/details");
+    endpoints.add("/rest/replication");
+    endpoints.add("/rest/statistics/time/ingestRate");
+    endpoints.add("/rest/statistics/time/scanEntries");
+    endpoints.add("/rest/statistics/time/ingestByteRate");
+    endpoints.add("/rest/statistics/time/queryByteRate");
+    endpoints.add("/rest/statistics/time/load");
+    endpoints.add("/rest/statistics/time/lookups");
+    endpoints.add("/rest/statistics/time/minorCompactions");
+    endpoints.add("/rest/statistics/time/majorCompactions");
+    endpoints.add("/rest/statistics/time/indexCacheHitRate");
+    endpoints.add("/rest/statistics/time/dataCacheHitRate");
+    endpoints.add("/rest/status");

Review Comment:
   Producing this statically means that this is almost certainly not going to be kept up-to-date. I think there may be a way to get these dynamically from the Application Resources or by peeking at the class path and looking at the `@GET` and `@POST` annotations.



##########
server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java:
##########
@@ -446,4 +446,49 @@ public Map<String,Object> getReplication() {
 
     return model;
   }
+
+  @GET
+  @Path("all")
+  @Template(name = "/default.ftl")
+  public Map<String,Object> getRestView() {
+
+    Map<String,Object> model = getModel();
+    model.put("title", "Rest Endpoints");
+
+    model.put("template", "debug.ftl");
+    model.put("js", "functions.js");
+
+    model.put("endpoints", getEndpoints());
+
+    return model;
+  }
+
+  private List<String> getEndpoints() {
+    List<String> endpoints = new ArrayList<>();

Review Comment:
   This should be a sorted set.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org