コード例 #1
0
 // 69, 1
 private void __jamon_innerUnit__baseStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 73, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n    <tr>\n\n        <th>Requests Per Second</th>\n        <th>Num. Regions</th>\n        <th>Block locality</th>\n        <th>Slow WAL Append Count</th>\n    </tr>\n    <tr>\n        <td>");
   // 82, 13
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())),
       jamonWriter);
   // 82, 70
   jamonWriter.write("</td>\n        <td>");
   // 83, 13
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
   // 83, 46
   jamonWriter.write("</td>\n        <td>");
   // 84, 13
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
   // 84, 46
   jamonWriter.write("</td>\n        <td>");
   // 85, 13
   org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(0), jamonWriter);
   // 85, 20
   jamonWriter.write("</td>\n    </tr>\n</table>\n");
 }
コード例 #2
0
ファイル: GtTemplateImpl.java プロジェクト: tgab/cs498
 public void renderNoFlush(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter)
     throws java.io.IOException {
   // 5, 1
   jamonWriter.write("// x > y ?\r\n@SP\r\nM=M-1\r\nA=M\r\nD=M\r\nA=A-1\r\nD=M-D\r\n\r\n@TRUE");
   // 13, 6
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(count), jamonWriter);
   // 13, 17
   jamonWriter.write("\r\nD;JGT\r\nD=0\r\n@END_EQ");
   // 16, 8
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(count), jamonWriter);
   // 16, 19
   jamonWriter.write("\r\n0;JMP\r\n\r\n(TRUE");
   // 19, 6
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(count), jamonWriter);
   // 19, 17
   jamonWriter.write(")\r\nD=-1\r\n\r\n(END_EQ");
   // 22, 8
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(count), jamonWriter);
   // 22, 19
   jamonWriter.write(")\r\n@SP\r\nA=M-1\r\nM=D\r\n");
 }
コード例 #3
0
  public void renderNoFlush(
      @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter)
      throws java.io.IOException {
    // 35, 1

    Collection<ServerName> backupMasters = null;
    if (master.isActiveMaster()) {
      ClusterStatus status = master.getClusterStatus();
      backupMasters = status.getBackupMasters();
    }

    // 43, 1
    jamonWriter.write("<table class=\"table table-striped\">\n");
    // 44, 1
    if ((backupMasters != null && backupMasters.size() > 0)) {
      // 44, 59
      jamonWriter.write(
          "\n<tr>\n    <th>ServerName</th>\n    <th>Port</th>\n    <th>Start Time</th>\n</tr>\n");
      // 50, 1

      ServerName[] serverNames = backupMasters.toArray(new ServerName[backupMasters.size()]);
      Arrays.sort(serverNames);
      for (ServerName serverName : serverNames) {

        // 55, 1
        jamonWriter.write("<tr>\n    <td>");
        // 56, 9
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
        // 56, 39
        jamonWriter.write("</td>\n    <td>");
        // 57, 9
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(serverName.getPort()), jamonWriter);
        // 57, 35
        jamonWriter.write("</td>\n    <td>");
        // 58, 9
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(new Date(serverName.getStartcode())),
            jamonWriter);
        // 58, 50
        jamonWriter.write("</td>\n</tr>\n");
        // 60, 1

      }
    }
    // 63, 7
    jamonWriter.write("\n<tr><td>Total:");
    // 64, 15
    org.jamon.escaping.Escaping.HTML.write(
        org.jamon.emit.StandardEmitter.valueOf((backupMasters != null) ? backupMasters.size() : 0),
        jamonWriter);
    // 64, 71
    jamonWriter.write("</td>\n</table>\n\n\n\n\n");
  }
コード例 #4
0
 // 90, 1
 private void __jamon_innerUnit__memoryStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 94, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n<tr>\n    <tr>\n        <th>Used Heap</th>\n        <th>Max Heap</th>\n        <th>Direct Memory Used</th>\n        <th>Direct Memory Configured</th>\n        <th>Memstore Size</th>\n    </tr>\n</tr>\n<tr>\n    <td>\n        ");
   // 106, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(
               ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed())),
       jamonWriter);
   // 106, 111
   jamonWriter.write("\n    </td>\n    <td>\n        ");
   // 109, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(
               ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax())),
       jamonWriter);
   // 109, 110
   jamonWriter.write("\n    </td>\n    <td>\n        ");
   // 112, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage())),
       jamonWriter);
   // 112, 85
   jamonWriter.write("\n    </td>\n    <td>\n        ");
   // 115, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize())),
       jamonWriter);
   // 115, 84
   jamonWriter.write("\n    </td>\n    <td>");
   // 117, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(mWrap.getMemstoreSize())),
       jamonWriter);
   // 117, 68
   jamonWriter.write("</td>\n</tr>\n</table>\n");
 }
コード例 #5
0
 // 122, 1
 private void __jamon_innerUnit__walStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 126, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n<tr>\n    <tr>\n        <th>Num. WAL Files</th>\n        <th>Size. WAL Files (bytes)</th>\n    </tr>\n</tr>\n<tr>\n    <td>");
   // 134, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter);
   // 134, 37
   jamonWriter.write("</td>\n    <td>");
   // 135, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getWALFileSize()), jamonWriter);
   // 135, 37
   jamonWriter.write("</td>\n</tr>\n</table>\n");
 }
コード例 #6
0
 // 182, 1
 private void __jamon_innerUnit__queueStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 186, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n<tr>\n    <th>Compaction Queue Size</th>\n    <th>Flush Queue Size</th>\n\n</tr>\n<tr>\n    <td>");
   // 193, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
   // 193, 45
   jamonWriter.write("</td>\n    <td>");
   // 194, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
   // 194, 40
   jamonWriter.write("</td>\n</tr>\n</table>\n");
 }
コード例 #7
0
 // 140, 1
 private void __jamon_innerUnit__storeStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 144, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n<tr>\n\n    <th>Num. Stores</th>\n    <th>Num. Storefiles</th>\n    <th>Root Index Size (bytes)</th>\n    <th>Index Size (bytes)</th>\n    <th>Bloom Size (bytes)</th>\n</tr>\n<tr>\n    <td>");
   // 154, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStores())),
       jamonWriter);
   // 154, 65
   jamonWriter.write("</td>\n    <td>");
   // 155, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(mWrap.getNumStoreFiles())),
       jamonWriter);
   // 155, 69
   jamonWriter.write("</td>\n    <td>");
   // 156, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize())),
       jamonWriter);
   // 156, 74
   jamonWriter.write("</td>\n    <td>");
   // 157, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize())),
       jamonWriter);
   // 157, 76
   jamonWriter.write("</td>\n    <td>");
   // 158, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(
           StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize())),
       jamonWriter);
   // 158, 76
   jamonWriter.write("</td>\n</tr>\n</table>\n");
 }
コード例 #8
0
 // 164, 1
 private void __jamon_innerUnit__requestStats(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter,
     final MetricsRegionServerWrapper mWrap)
     throws java.io.IOException {
   // 168, 1
   jamonWriter.write(
       "<table class=\"table table-striped\">\n<tr>\n    <th>Request Per Second</th>\n    <th>Read Request Count</th>\n    <th>Write Request Count</th>\n</tr>\n<tr>\n    <td>");
   // 175, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())),
       jamonWriter);
   // 175, 66
   jamonWriter.write("</td>\n    <td>");
   // 176, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
   // 176, 43
   jamonWriter.write("</td>\n    <td>");
   // 177, 9
   org.jamon.escaping.Escaping.HTML.write(
       org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
   // 177, 44
   jamonWriter.write("</td>\n</tr>\n</table>\n");
 }
コード例 #9
0
  @Override
  public void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException {
    // 7, 1

    int lc = 0;
    String klass = "";

    // 11, 1
    jamonWriter.write(
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n          \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n <head>\n  <title>Stock Prices</title>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n  <link rel=\"shortcut icon\" href=\"/images/favicon.ico\" />\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/style.css\" media=\"all\" />\n  <script type=\"text/javascript\" src=\"/js/util.js\"></script>\n  <style type=\"text/css\">\n  /*<![CDATA[*/\n\nbody {\n    color: #333333;\n    line-height: 150%;\n}\n\nthead {\n    font-weight: bold;\n    background-color: #CCCCCC;\n}\n\n.odd {\n    background-color: #FFCCCC;\n}\n\n.even {\n    background-color: #CCCCFF;\n}\n\n.minus {\n    color: #FF0000;\n}\n\n  /*]]>*/\n  </style>\n\n </head>\n\n <body>\n\n  <h1>Stock Prices</h1>\n\n  <table>\n   <thead>\n    <tr>\n     <th>#</th><th>symbol</th><th>name</th><th>price</th><th>change</th><th>ratio</th>\n    </tr>\n   </thead>\n   <tbody>\n");
    // 64, 1
    for (Stock item : items) {
      // 64, 27
      jamonWriter.write("\n    ");
      // 65, 5
      klass = (lc++ % 2 == 0) ? "even" : "odd";
      // 66, 5
      jamonWriter.write("<tr class=\"");
      // 66, 16
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(klass), jamonWriter);
      // 66, 27
      jamonWriter.write("\">\n     <td style=\"text-align: center\">");
      // 67, 37
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(lc), jamonWriter);
      // 67, 45
      jamonWriter.write("</td>\n     <td>\n      <a href=\"/stocks/");
      // 69, 24
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(item.getSymbol()), jamonWriter);
      // 69, 46
      jamonWriter.write("\">");
      // 69, 48
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(item.getSymbol()), jamonWriter);
      // 69, 70
      jamonWriter.write("</a>\n     </td>\n     <td>\n      <a href=\"");
      // 72, 16
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(item.getUrl()), jamonWriter);
      // 72, 35
      jamonWriter.write("\">");
      // 72, 37
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(item.getName()), jamonWriter);
      // 72, 57
      jamonWriter.write("</a>\n     </td>\n     <td>\n      <strong>");
      // 75, 15
      org.jamon.escaping.Escaping.HTML.write(
          org.jamon.emit.StandardEmitter.valueOf(item.getPrice()), jamonWriter);
      // 75, 36
      jamonWriter.write("</strong>\n     </td>\n     ");
      // 77, 6
      if (item.getChange() < 0.0) {
        // 77, 36
        jamonWriter.write("\n     <td class=\"minus\">");
        // 78, 24
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(item.getChange()), jamonWriter);
        // 78, 46
        jamonWriter.write("</td>\n     <td class=\"minus\">");
        // 79, 24
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(item.getRatio()), jamonWriter);
        // 79, 45
        jamonWriter.write("</td>\n     ");
      }
      // 80, 6
      else {
        // 80, 13
        jamonWriter.write("\n     <td>");
        // 81, 10
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(item.getChange()), jamonWriter);
        // 81, 32
        jamonWriter.write("</td>\n     <td>");
        // 82, 10
        org.jamon.escaping.Escaping.HTML.write(
            org.jamon.emit.StandardEmitter.valueOf(item.getChange()), jamonWriter);
        // 82, 32
        jamonWriter.write("</td>\n     ");
      }
      // 83, 12
      jamonWriter.write("\n    </tr>\n");
    }
    // 85, 8
    jamonWriter.write("\n   </tbody>\n  </table>\n\n </body>\n</html>\n");
  }