accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivakegg <...@git.apache.org>
Subject [GitHub] accumulo pull request #271: ACCUMULO-4655 Added a Response Time column to th...
Date Tue, 20 Jun 2017 18:28:33 GMT
Github user ivakegg commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/271#discussion_r123057896
  
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/TServersServlet.java
---
    @@ -309,18 +309,28 @@ public static void doDeadServerTable(HttpServletRequest req, StringBuilder
sb, T
         }
       }
     
    +  static final long SECOND = 1000;
    +  static final long RESPONSE_TIME_MAX_ERR = 3 * SECOND;
    +  static final long MINUTE = 60 * SECOND;
    +  static final long LAST_CONTEXT_MAX_ERR = 3 * MINUTE;
    +
       static void doTserverList(HttpServletRequest req, StringBuilder sb, List<TabletServerStatus>
tservers, String tableId, Table tServerList) {
         int guessHighLoad = ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors();
         long now = System.currentTimeMillis();
     
         double avgLastContact = 0.;
    +    double avgResponseTime = 0.;
    +    int count = 0;
         for (TabletServerStatus status : tservers) {
    +      count++;
           avgLastContact += (now - status.lastContact);
    +      avgResponseTime += status.responseTime;
         }
    -    final long MINUTES = 3 * 60 * 1000;
    +    avgResponseTime /= count;
         tServerList.addSortableColumn("Server", new TServerLinkType(), null);
         tServerList.addSortableColumn("Hosted&nbsp;Tablets", new NumberType<>(0,
Integer.MAX_VALUE), null);
    -    tServerList.addSortableColumn("Last&nbsp;Contact", new DurationType(0l, (long)
Math.min(avgLastContact * 4, MINUTES)), null);
    +    tServerList.addSortableColumn("Last&nbsp;Contact", new DurationType(0l, (long)
Math.min(avgLastContact * 4, LAST_CONTEXT_MAX_ERR)), null);
    --- End diff --
    
    ...and why are we multiplying the (not so) average by 4?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message