001// Autogenerated Jamon implementation
002// /home/vagrant/repos/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
003
004package org.apache.hadoop.hbase.tmpl.regionserver;
005
006// 25, 1
007import java.util.*;
008// 26, 1
009import org.apache.hadoop.hbase.regionserver.HRegionServer;
010// 27, 1
011import org.apache.hadoop.hbase.io.ByteBuffAllocator;
012// 28, 1
013import org.apache.hadoop.hbase.ipc.MetricsHBaseServerWrapper;
014// 29, 1
015import org.apache.hadoop.hbase.regionserver.MetricsRegionServerWrapper;
016// 30, 1
017import org.apache.hadoop.hbase.util.Bytes;
018// 31, 1
019import org.apache.hadoop.hbase.HRegionInfo;
020// 32, 1
021import org.apache.hadoop.hbase.ServerName;
022// 33, 1
023import org.apache.hadoop.hbase.HBaseConfiguration;
024// 34, 1
025import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
026// 35, 1
027import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
028// 36, 1
029import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
030// 37, 1
031import org.apache.hadoop.hbase.util.DirectMemoryUtils;
032// 38, 1
033import org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
034// 39, 1
035import java.lang.management.MemoryUsage;
036// 40, 1
037import org.apache.hadoop.hbase.io.util.MemorySizeUtil;
038
039public class ServerMetricsTmplImpl
040  extends org.jamon.AbstractTemplateImpl
041  implements org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.Intf
042
043{
044  private final MetricsRegionServerWrapper mWrap;
045  private final MetricsHBaseServerWrapper mServerWrap;
046  private final ByteBuffAllocator bbAllocator;
047  protected static org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
048  {
049    return p_implData;
050  }
051  public ServerMetricsTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
052  {
053    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
054    mWrap = p_implData.getMWrap();
055    mServerWrap = p_implData.getMServerWrap();
056    bbAllocator = p_implData.getBbAllocator();
057  }
058  
059  @Override public void renderNoFlush(final java.io.Writer jamonWriter)
060    throws java.io.IOException
061  {
062    // 42, 1
063    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        <li class=\"\"><a href=\"#tab_byteBuffAllocatorStats\" data-toggle=\"tab\">ByteBuffAllocator Stats</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            ");
064    // 54, 13
065    {
066      // 54, 13
067      __jamon_innerUnit__baseStats(jamonWriter, mWrap );
068    }
069    // 54, 43
070    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_memoryStats\">\n            ");
071    // 57, 13
072    {
073      // 57, 13
074      __jamon_innerUnit__memoryStats(jamonWriter, mWrap );
075    }
076    // 57, 45
077    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_requestStats\">\n            ");
078    // 60, 13
079    {
080      // 60, 13
081      __jamon_innerUnit__requestStats(jamonWriter, mWrap );
082    }
083    // 60, 46
084    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_walStats\">\n            ");
085    // 63, 13
086    {
087      // 63, 13
088      __jamon_innerUnit__walStats(jamonWriter, mWrap );
089    }
090    // 63, 42
091    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_storeStats\">\n            ");
092    // 66, 13
093    {
094      // 66, 13
095      __jamon_innerUnit__storeStats(jamonWriter, mWrap );
096    }
097    // 66, 44
098    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_queueStats\">\n            ");
099    // 69, 13
100    {
101      // 69, 13
102      __jamon_innerUnit__queueStats(jamonWriter, mWrap, mServerWrap);
103    }
104    // 69, 72
105    jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_byteBuffAllocatorStats\">\n            ");
106    // 72, 13
107    {
108      // 72, 13
109      __jamon_innerUnit__byteBuffAllocatorStats(jamonWriter, bbAllocator);
110    }
111    // 72, 69
112    jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
113  }
114  
115  
116  // 77, 1
117  private void __jamon_innerUnit__baseStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
118    throws java.io.IOException
119  {
120    // 81, 1
121    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>");
122    // 91, 13
123    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
124    // 91, 70
125    jamonWriter.write("</td>\n        <td>");
126    // 92, 13
127    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
128    // 92, 46
129    jamonWriter.write("</td>\n        <td>");
130    // 93, 13
131    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.3f",mWrap.getPercentFileLocal())), jamonWriter);
132    // 93, 68
133    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter);
134    // 93, 77
135    jamonWriter.write("</td>\n        <td>");
136    // 94, 13
137    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.3f",mWrap.getPercentFileLocalSecondaryRegions())), jamonWriter);
138    // 94, 84
139    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter);
140    // 94, 93
141    jamonWriter.write("</td>\n        <td>");
142    // 95, 13
143    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALSlowAppend()), jamonWriter);
144    // 95, 46
145    jamonWriter.write("</td>\n    </tr>\n</table>\n");
146  }
147  
148  
149  // 235, 1
150  private void __jamon_innerUnit__byteBuffAllocatorStats(final java.io.Writer jamonWriter, final ByteBuffAllocator bbAllocator)
151    throws java.io.IOException
152  {
153    // 239, 1
154    jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n    <th>Total Heap Allocation</th>\n    <th>Total Pool Allocation</th>\n    <th>Heap Allocation Ratio</th>\n    <th>Total Buffer Count</th>\n    <th>Used Buffer Count</th>\n    <th>Buffer Size</th>\n</tr>\n<tr>\n    <td>");
155    // 249, 9
156    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(ByteBuffAllocator.getHeapAllocationBytes(bbAllocator, ByteBuffAllocator.HEAP), "B", 1)), jamonWriter);
157    // 249, 137
158    jamonWriter.write("</td>\n    <td>");
159    // 250, 9
160    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bbAllocator.getPoolAllocationBytes(), "B", 1)), jamonWriter);
161    // 250, 96
162    jamonWriter.write("</td>\n    <td>");
163    // 251, 9
164    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.3f", ByteBuffAllocator.getHeapAllocationRatio(bbAllocator, ByteBuffAllocator.HEAP) * 100)), jamonWriter);
165    // 251, 121
166    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf("%"), jamonWriter);
167    // 251, 130
168    jamonWriter.write("</td>\n    <td>");
169    // 252, 9
170    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bbAllocator.getTotalBufferCount()), jamonWriter);
171    // 252, 48
172    jamonWriter.write("</td>\n    <td>");
173    // 253, 9
174    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(bbAllocator.getUsedBufferCount()), jamonWriter);
175    // 253, 47
176    jamonWriter.write("</td>\n    <td>");
177    // 254, 9
178    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(bbAllocator.getBufferSize(), "B", 1)), jamonWriter);
179    // 254, 87
180    jamonWriter.write("</td>\n</tr>\n</table>\n");
181  }
182  
183  
184  // 100, 1
185  private void __jamon_innerUnit__memoryStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
186    throws java.io.IOException
187  {
188    // 104, 1
189    long usedHeap = -1L;
190  long maxHeap = -1L;
191  final MemoryUsage usage = MemorySizeUtil.safeGetHeapMemoryUsage();
192  if (usage != null) {
193    maxHeap = usage.getMax();
194    usedHeap = usage.getUsed();
195  }
196
197    // 113, 1
198    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        ");
199    // 126, 9
200    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(usedHeap, "B", 1)), jamonWriter);
201    // 126, 68
202    jamonWriter.write("\n    </td>\n    <td>\n        ");
203    // 129, 9
204    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(maxHeap, "B", 1)), jamonWriter);
205    // 129, 67
206    jamonWriter.write("\n    </td>\n    <td>\n        ");
207    // 132, 9
208    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemoryUsage(), "B", 1)), jamonWriter);
209    // 132, 100
210    jamonWriter.write("\n    </td>\n    <td>\n        ");
211    // 135, 9
212    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(), "B", 1)), jamonWriter);
213    // 135, 99
214    jamonWriter.write("\n    </td>\n    <td>\n        ");
215    // 138, 9
216    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getMemStoreSize(), "B", 1)), jamonWriter);
217    // 138, 83
218    jamonWriter.write("\n    </td>\n    <td>\n        ");
219    // 141, 9
220    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getMemStoreLimit(), "B", 1)), jamonWriter);
221    // 141, 84
222    jamonWriter.write("\n    </td>\n</tr>\n</table>\n");
223  }
224  
225  
226  // 209, 1
227  private void __jamon_innerUnit__queueStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap, final MetricsHBaseServerWrapper mServerWrap)
228    throws java.io.IOException
229  {
230    // 214, 1
231    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>");
232    // 225, 9
233    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
234    // 225, 45
235    jamonWriter.write("</td>\n    <td>");
236    // 226, 9
237    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
238    // 226, 40
239    jamonWriter.write("</td>\n    <td>");
240    // 227, 9
241    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getPriorityQueueLength()), jamonWriter);
242    // 227, 51
243    jamonWriter.write("</td>\n    <td>");
244    // 228, 9
245    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getGeneralQueueLength()), jamonWriter);
246    // 228, 50
247    jamonWriter.write("</td>\n    <td>");
248    // 229, 9
249    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getReplicationQueueLength()), jamonWriter);
250    // 229, 54
251    jamonWriter.write("</td>\n    <td>");
252    // 230, 9
253    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(), "B", 1)), jamonWriter);
254    // 230, 91
255    jamonWriter.write("</td>\n</tr>\n</table>\n");
256  }
257  
258  
259  // 189, 1
260  private void __jamon_innerUnit__requestStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
261    throws java.io.IOException
262  {
263    // 193, 1
264    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>");
265    // 201, 9
266    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
267    // 201, 66
268    jamonWriter.write("</td>\n    <td>");
269    // 202, 9
270    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
271    // 202, 43
272    jamonWriter.write("</td>\n    <td>");
273    // 203, 9
274    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFilteredReadRequestsCount()), jamonWriter);
275    // 203, 51
276    jamonWriter.write("</td>\n    <td>");
277    // 204, 9
278    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
279    // 204, 44
280    jamonWriter.write("</td>\n</tr>\n</table>\n");
281  }
282  
283  
284  // 165, 1
285  private void __jamon_innerUnit__storeStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
286    throws java.io.IOException
287  {
288    // 169, 1
289    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>");
290    // 179, 9
291    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStores()), jamonWriter);
292    // 179, 35
293    jamonWriter.write("</td>\n    <td>");
294    // 180, 9
295    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStoreFiles()), jamonWriter);
296    // 180, 39
297    jamonWriter.write("</td>\n    <td>");
298    // 181, 9
299    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getStoreFileIndexSize(), "B", 1)), jamonWriter);
300    // 181, 89
301    jamonWriter.write("</td>\n    <td>");
302    // 182, 9
303    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticIndexSize(), "B", 1)), jamonWriter);
304    // 182, 91
305    jamonWriter.write("</td>\n    <td>");
306    // 183, 9
307    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticBloomSize(), "B", 1)), jamonWriter);
308    // 183, 91
309    jamonWriter.write("</td>\n</tr>\n</table>\n");
310  }
311  
312  
313  // 147, 1
314  private void __jamon_innerUnit__walStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
315    throws java.io.IOException
316  {
317    // 151, 1
318    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>");
319    // 159, 9
320    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter);
321    // 159, 37
322    jamonWriter.write("</td>\n    <td>");
323    // 160, 9
324    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getWALFileSize(), "B", 1)), jamonWriter);
325    // 160, 82
326    jamonWriter.write("</td>\n</tr>\n</table>\n");
327  }
328  
329  
330}