001// Autogenerated Jamon implementation 002// /Users/peter.somogyi/Cloudera/repos/hbase-upstream/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon 003 004package org.apache.hadoop.hbase.tmpl.regionserver; 005 006// 24, 1 007import java.util.*; 008// 25, 1 009import org.apache.hadoop.hbase.regionserver.HRegionServer; 010// 26, 1 011import org.apache.hadoop.hbase.ipc.MetricsHBaseServerWrapper; 012// 27, 1 013import org.apache.hadoop.hbase.regionserver.MetricsRegionServerWrapper; 014// 28, 1 015import org.apache.hadoop.hbase.util.Bytes; 016// 29, 1 017import org.apache.hadoop.hbase.HRegionInfo; 018// 30, 1 019import org.apache.hadoop.hbase.ServerName; 020// 31, 1 021import org.apache.hadoop.hbase.HBaseConfiguration; 022// 32, 1 023import org.apache.hadoop.hbase.protobuf.ProtobufUtil; 024// 33, 1 025import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo; 026// 34, 1 027import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad; 028// 35, 1 029import org.apache.hadoop.hbase.util.DirectMemoryUtils; 030// 36, 1 031import org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix; 032// 37, 1 033import java.lang.management.MemoryUsage; 034// 38, 1 035import org.apache.hadoop.hbase.io.util.MemorySizeUtil; 036 037public class ServerMetricsTmplImpl 038 extends org.jamon.AbstractTemplateImpl 039 implements org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.Intf 040 041{ 042 private final MetricsRegionServerWrapper mWrap; 043 private final MetricsHBaseServerWrapper mServerWrap; 044 protected static org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData) 045 { 046 return p_implData; 047 } 048 public ServerMetricsTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData) 049 { 050 super(p_templateManager, __jamon_setOptionalArguments(p_implData)); 051 mWrap = p_implData.getMWrap(); 052 mServerWrap = p_implData.getMServerWrap(); 053 } 054 055 @Override public void renderNoFlush(final java.io.Writer jamonWriter) 056 throws java.io.IOException 057 { 058 // 40, 1 059 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 "); 060 // 51, 13 061 { 062 // 51, 13 063 __jamon_innerUnit__baseStats(jamonWriter, mWrap ); 064 } 065 // 51, 43 066 jamonWriter.write("\n </div>\n <div class=\"tab-pane\" id=\"tab_memoryStats\">\n "); 067 // 54, 13 068 { 069 // 54, 13 070 __jamon_innerUnit__memoryStats(jamonWriter, mWrap ); 071 } 072 // 54, 45 073 jamonWriter.write("\n </div>\n <div class=\"tab-pane\" id=\"tab_requestStats\">\n "); 074 // 57, 13 075 { 076 // 57, 13 077 __jamon_innerUnit__requestStats(jamonWriter, mWrap ); 078 } 079 // 57, 46 080 jamonWriter.write("\n </div>\n <div class=\"tab-pane\" id=\"tab_walStats\">\n "); 081 // 60, 13 082 { 083 // 60, 13 084 __jamon_innerUnit__walStats(jamonWriter, mWrap ); 085 } 086 // 60, 42 087 jamonWriter.write("\n </div>\n <div class=\"tab-pane\" id=\"tab_storeStats\">\n "); 088 // 63, 13 089 { 090 // 63, 13 091 __jamon_innerUnit__storeStats(jamonWriter, mWrap ); 092 } 093 // 63, 44 094 jamonWriter.write("\n </div>\n <div class=\"tab-pane\" id=\"tab_queueStats\">\n "); 095 // 66, 13 096 { 097 // 66, 13 098 __jamon_innerUnit__queueStats(jamonWriter, mWrap, mServerWrap); 099 } 100 // 66, 72 101 jamonWriter.write("\n </div>\n </div>\n</div>\n\n"); 102 } 103 104 105 // 71, 1 106 private void __jamon_innerUnit__baseStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap) 107 throws java.io.IOException 108 { 109 // 75, 1 110 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>Block locality (Secondary replicas)</th>\n <th>Slow WAL Append Count</th>\n </tr>\n <tr>\n <td>"); 111 // 85, 13 112 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter); 113 // 85, 70 114 jamonWriter.write("</td>\n <td>"); 115 // 86, 13 116 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter); 117 // 86, 46 118 jamonWriter.write("</td>\n <td>"); 119 // 87, 13 120 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter); 121 // 87, 46 122 jamonWriter.write("</td>\n <td>"); 123 // 88, 13 124 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocalSecondaryRegions()), jamonWriter); 125 // 88, 62 126 jamonWriter.write("</td>\n <td>"); 127 // 89, 13 128 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALSlowAppend()), jamonWriter); 129 // 89, 46 130 jamonWriter.write("</td>\n </tr>\n</table>\n"); 131 } 132 133 134 // 94, 1 135 private void __jamon_innerUnit__memoryStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap) 136 throws java.io.IOException 137 { 138 // 98, 1 139 long usedHeap = -1L; 140 long maxHeap = -1L; 141 final MemoryUsage usage = MemorySizeUtil.safeGetHeapMemoryUsage(); 142 if (usage != null) { 143 maxHeap = usage.getMax(); 144 usedHeap = usage.getUsed(); 145 } 146 147 // 107, 1 148 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 <th>Memstore Limit</th>\n </tr>\n</tr>\n<tr>\n <td>\n "); 149 // 120, 9 150 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(usedHeap, "B", 1)), jamonWriter); 151 // 120, 68 152 jamonWriter.write("\n </td>\n <td>\n "); 153 // 123, 9 154 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(maxHeap, "B", 1)), jamonWriter); 155 // 123, 67 156 jamonWriter.write("\n </td>\n <td>\n "); 157 // 126, 9 158 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemoryUsage(), "B", 1)), jamonWriter); 159 // 126, 100 160 jamonWriter.write("\n </td>\n <td>\n "); 161 // 129, 9 162 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(), "B", 1)), jamonWriter); 163 // 129, 99 164 jamonWriter.write("\n </td>\n <td>\n "); 165 // 132, 9 166 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getMemStoreSize(), "B", 1)), jamonWriter); 167 // 132, 83 168 jamonWriter.write("\n </td>\n <td>\n "); 169 // 135, 9 170 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getMemStoreLimit(), "B", 1)), jamonWriter); 171 // 135, 84 172 jamonWriter.write("\n </td>\n</tr>\n</table>\n"); 173 } 174 175 176 // 203, 1 177 private void __jamon_innerUnit__queueStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap, final MetricsHBaseServerWrapper mServerWrap) 178 throws java.io.IOException 179 { 180 // 208, 1 181 jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n <th>Compaction Queue Length</th>\n <th>Flush Queue Length</th>\n <th>Priority Call Queue Length</th>\n <th>General Call Queue Length</th>\n <th>Replication Call Queue Length</th>\n <th>Total Call Queue Size</th>\n\n</tr>\n<tr>\n <td>"); 182 // 219, 9 183 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter); 184 // 219, 45 185 jamonWriter.write("</td>\n <td>"); 186 // 220, 9 187 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter); 188 // 220, 40 189 jamonWriter.write("</td>\n <td>"); 190 // 221, 9 191 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getPriorityQueueLength()), jamonWriter); 192 // 221, 51 193 jamonWriter.write("</td>\n <td>"); 194 // 222, 9 195 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getGeneralQueueLength()), jamonWriter); 196 // 222, 50 197 jamonWriter.write("</td>\n <td>"); 198 // 223, 9 199 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getReplicationQueueLength()), jamonWriter); 200 // 223, 54 201 jamonWriter.write("</td>\n <td>"); 202 // 224, 9 203 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(), "B", 1)), jamonWriter); 204 // 224, 91 205 jamonWriter.write("</td>\n</tr>\n</table>\n"); 206 } 207 208 209 // 183, 1 210 private void __jamon_innerUnit__requestStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap) 211 throws java.io.IOException 212 { 213 // 187, 1 214 jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n <th>Request Per Second</th>\n <th>Read Request Count</th>\n <th>Filtered Read Request Count</th>\n <th>Write Request Count</th>\n</tr>\n<tr>\n <td>"); 215 // 195, 9 216 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter); 217 // 195, 66 218 jamonWriter.write("</td>\n <td>"); 219 // 196, 9 220 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter); 221 // 196, 43 222 jamonWriter.write("</td>\n <td>"); 223 // 197, 9 224 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFilteredReadRequestsCount()), jamonWriter); 225 // 197, 51 226 jamonWriter.write("</td>\n <td>"); 227 // 198, 9 228 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter); 229 // 198, 44 230 jamonWriter.write("</td>\n</tr>\n</table>\n"); 231 } 232 233 234 // 159, 1 235 private void __jamon_innerUnit__storeStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap) 236 throws java.io.IOException 237 { 238 // 163, 1 239 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</th>\n <th>Index Size</th>\n <th>Bloom Size</th>\n</tr>\n<tr>\n <td>"); 240 // 173, 9 241 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStores()), jamonWriter); 242 // 173, 35 243 jamonWriter.write("</td>\n <td>"); 244 // 174, 9 245 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStoreFiles()), jamonWriter); 246 // 174, 39 247 jamonWriter.write("</td>\n <td>"); 248 // 175, 9 249 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getStoreFileIndexSize(), "B", 1)), jamonWriter); 250 // 175, 89 251 jamonWriter.write("</td>\n <td>"); 252 // 176, 9 253 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticIndexSize(), "B", 1)), jamonWriter); 254 // 176, 91 255 jamonWriter.write("</td>\n <td>"); 256 // 177, 9 257 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticBloomSize(), "B", 1)), jamonWriter); 258 // 177, 91 259 jamonWriter.write("</td>\n</tr>\n</table>\n"); 260 } 261 262 263 // 141, 1 264 private void __jamon_innerUnit__walStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap) 265 throws java.io.IOException 266 { 267 // 145, 1 268 jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n <tr>\n <th>Num. WAL Files</th>\n <th>Size. WAL Files</th>\n </tr>\n</tr>\n<tr>\n <td>"); 269 // 153, 9 270 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter); 271 // 153, 37 272 jamonWriter.write("</td>\n <td>"); 273 // 154, 9 274 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getWALFileSize(), "B", 1)), jamonWriter); 275 // 154, 82 276 jamonWriter.write("</td>\n</tr>\n</table>\n"); 277 } 278 279 280}