Exemplo n.º 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");
 }
Exemplo n.º 2
0
  /** write a segment to an output stream. */
  void write(java.io.Writer os, char encoding[]) throws Exception {
    os.write(name);
    Iterator it = fields.iterator();
    // handling for msh - ignore the first two fields - but write the encoding characters directly
    if (name.equals("MSH")) {
      it.next();
      it.next();
      os.write(encoding);
    }

    while (it.hasNext()) {
      os.write(encoding[0]);
      Field fld = (Field) it.next();
      if (fld != null) os.write(fld.encode(encoding));
    }
  }
  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");
  }
Exemplo n.º 4
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");
 }
Exemplo n.º 5
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");
 }
Exemplo n.º 6
0
 public void renderNoFlush(
     @SuppressWarnings({"unused", "hiding"}) final java.io.Writer jamonWriter)
     throws java.io.IOException {
   // 38, 1
   jamonWriter.write(
       "<div class=\"tabbable\">\n    <ul class=\"nav nav-pills\">\n        <li class=\"active\"><a href=\"#tab_baseStats\" data-toggle=\"tab\">Base Stats</a></li>\n        <li class=\"\"><a href=\"#tab_memoryStats\" data-toggle=\"tab\">Memory</a></li>\n        <li class=\"\"><a href=\"#tab_requestStats\" data-toggle=\"tab\">Requests</a></li>\n        <li class=\"\"><a href=\"#tab_walStats\" data-toggle=\"tab\">WALs</a></li>\n        <li class=\"\"><a href=\"#tab_storeStats\" data-toggle=\"tab\">Storefiles</a></li>\n        <li class=\"\"><a href=\"#tab_queueStats\" data-toggle=\"tab\">Queues</a></li>\n    </ul>\n    <div class=\"tab-content\" style=\"padding-bottom: 9px; border-bottom: 1px solid #ddd;\">\n        <div class=\"tab-pane active\" id=\"tab_baseStats\">\n            ");
   // 49, 13
   {
     // 49, 13
     __jamon_innerUnit__baseStats(jamonWriter, mWrap);
   }
   // 49, 43
   jamonWriter.write(
       "\n        </div>\n        <div class=\"tab-pane\" id=\"tab_memoryStats\">\n            ");
   // 52, 13
   {
     // 52, 13
     __jamon_innerUnit__memoryStats(jamonWriter, mWrap);
   }
   // 52, 45
   jamonWriter.write(
       "\n        </div>\n        <div class=\"tab-pane\" id=\"tab_requestStats\">\n            ");
   // 55, 13
   {
     // 55, 13
     __jamon_innerUnit__requestStats(jamonWriter, mWrap);
   }
   // 55, 46
   jamonWriter.write(
       "\n        </div>\n        <div class=\"tab-pane\" id=\"tab_walStats\">\n            ");
   // 58, 13
   {
     // 58, 13
     __jamon_innerUnit__walStats(jamonWriter, mWrap);
   }
   // 58, 42
   jamonWriter.write(
       "\n        </div>\n        <div class=\"tab-pane\" id=\"tab_storeStats\">\n            ");
   // 61, 13
   {
     // 61, 13
     __jamon_innerUnit__storeStats(jamonWriter, mWrap);
   }
   // 61, 44
   jamonWriter.write(
       "\n        </div>\n        <div class=\"tab-pane\" id=\"tab_queueStats\">\n            ");
   // 64, 13
   {
     // 64, 13
     __jamon_innerUnit__queueStats(jamonWriter, mWrap);
   }
   // 64, 45
   jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
 }
Exemplo n.º 7
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");
 }
Exemplo n.º 8
0
 public static void writeXMLHeader(java.io.Writer out, VariableTable vt, String xsldoc)
     throws java.io.IOException {
   String db_charset = "gb2312";
   if (vt.exists("WEBCHART.DB_CHARSET")) {
     db_charset = vt.getString("WEBCHART.DB_CHARSET");
   }
   if (db_charset != null) out.write("<?xml version='1.0' encoding='" + db_charset + "'?>\n");
   else out.write("<?xml version='1.0'?>\n");
   out.write("<!-- Generated by AnySQL DataReport (WebChart), Version 4.0.0 (2009-12-04) -->\n");
   out.write("<!-- Copyright reserved, Lou Fangxin (AnySQL.net) 2003-2009 -->\n");
   if (xsldoc != null && xsldoc.length() > 0) {
     out.write("<?xml-stylesheet type='text/xsl' href='");
     out.write(xsldoc + "'?>\n");
   }
 }
Exemplo n.º 9
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");
 }
Exemplo n.º 10
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");
 }