View Javadoc

1   // Autogenerated Jamon implementation
2   // /home/busbey/projects/hbase/hbase-assembly/target/hbase-1.2.6/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
3   
4   package org.apache.hadoop.hbase.tmpl.regionserver;
5   
6   // 24, 1
7   import java.util.*;
8   // 25, 1
9   import org.apache.hadoop.hbase.regionserver.HRegionServer;
10  // 26, 1
11  import org.apache.hadoop.hbase.ipc.MetricsHBaseServerWrapper;
12  // 27, 1
13  import org.apache.hadoop.hbase.regionserver.MetricsRegionServerWrapper;
14  // 28, 1
15  import org.apache.hadoop.hbase.util.Bytes;
16  // 29, 1
17  import org.apache.hadoop.hbase.HRegionInfo;
18  // 30, 1
19  import org.apache.hadoop.hbase.ServerName;
20  // 31, 1
21  import org.apache.hadoop.hbase.HBaseConfiguration;
22  // 32, 1
23  import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
24  // 33, 1
25  import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
26  // 34, 1
27  import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
28  // 35, 1
29  import org.apache.hadoop.hbase.util.DirectMemoryUtils;
30  // 36, 1
31  import org.apache.hadoop.util.StringUtils;
32  // 37, 1
33  import java.lang.management.MemoryUsage;
34  // 38, 1
35  import org.apache.hadoop.hbase.io.util.HeapMemorySizeUtil;
36  
37  public class ServerMetricsTmplImpl
38    extends org.jamon.AbstractTemplateImpl
39    implements org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.Intf
40  
41  {
42    private final MetricsRegionServerWrapper mWrap;
43    private final MetricsHBaseServerWrapper mServerWrap;
44    protected static org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
45    {
46      return p_implData;
47    }
48    public ServerMetricsTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
49    {
50      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
51      mWrap = p_implData.getMWrap();
52      mServerWrap = p_implData.getMServerWrap();
53    }
54    
55    @Override public void renderNoFlush(final java.io.Writer jamonWriter)
56      throws java.io.IOException
57    {
58      // 40, 1
59      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            ");
60      // 51, 13
61      {
62        // 51, 13
63        __jamon_innerUnit__baseStats(jamonWriter, mWrap );
64      }
65      // 51, 43
66      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_memoryStats\">\n            ");
67      // 54, 13
68      {
69        // 54, 13
70        __jamon_innerUnit__memoryStats(jamonWriter, mWrap );
71      }
72      // 54, 45
73      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_requestStats\">\n            ");
74      // 57, 13
75      {
76        // 57, 13
77        __jamon_innerUnit__requestStats(jamonWriter, mWrap );
78      }
79      // 57, 46
80      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_walStats\">\n            ");
81      // 60, 13
82      {
83        // 60, 13
84        __jamon_innerUnit__walStats(jamonWriter, mWrap );
85      }
86      // 60, 42
87      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_storeStats\">\n            ");
88      // 63, 13
89      {
90        // 63, 13
91        __jamon_innerUnit__storeStats(jamonWriter, mWrap );
92      }
93      // 63, 44
94      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_queueStats\">\n            ");
95      // 66, 13
96      {
97        // 66, 13
98        __jamon_innerUnit__queueStats(jamonWriter, mWrap, mServerWrap);
99      }
100     // 66, 72
101     jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
102   }
103   
104   
105   // 177, 1
106   private void __jamon_innerUnit__requestStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
107     throws java.io.IOException
108   {
109     // 181, 1
110     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>");
111     // 188, 9
112     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
113     // 188, 66
114     jamonWriter.write("</td>\n    <td>");
115     // 189, 9
116     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
117     // 189, 43
118     jamonWriter.write("</td>\n    <td>");
119     // 190, 9
120     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
121     // 190, 44
122     jamonWriter.write("</td>\n</tr>\n</table>\n");
123   }
124   
125   
126   // 195, 1
127   private void __jamon_innerUnit__queueStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap, final MetricsHBaseServerWrapper mServerWrap)
128     throws java.io.IOException
129   {
130     // 200, 1
131     jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n    <th>Compaction Queue Size</th>\n    <th>Flush Queue Size</th>\n    <th>Call Queue Size (bytes)</th>\n\n</tr>\n<tr>\n    <td>");
132     // 208, 9
133     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
134     // 208, 45
135     jamonWriter.write("</td>\n    <td>");
136     // 209, 9
137     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
138     // 209, 40
139     jamonWriter.write("</td>\n    <td>");
140     // 210, 9
141     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(),
142       "", 1)), jamonWriter);
143     // 211, 16
144     jamonWriter.write("</td>\n</tr>\n</table>\n");
145   }
146   
147   
148   // 94, 1
149   private void __jamon_innerUnit__memoryStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
150     throws java.io.IOException
151   {
152     // 98, 1
153     long usedHeap = -1L;
154   long maxHeap = -1L;
155   final MemoryUsage usage = HeapMemorySizeUtil.safeGetHeapMemoryUsage();
156   if (usage != null) {
157     maxHeap = usage.getMax();
158     usedHeap = usage.getUsed();
159   }
160 
161     // 107, 1
162     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        ");
163     // 119, 9
164     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(usedHeap)), jamonWriter);
165     // 119, 53
166     jamonWriter.write("\n    </td>\n    <td>\n        ");
167     // 122, 9
168     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(maxHeap)), jamonWriter);
169     // 122, 52
170     jamonWriter.write("\n    </td>\n    <td>\n        ");
171     // 125, 9
172     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage())), jamonWriter);
173     // 125, 85
174     jamonWriter.write("\n    </td>\n    <td>\n        ");
175     // 128, 9
176     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize())), jamonWriter);
177     // 128, 84
178     jamonWriter.write("\n    </td>\n    <td>");
179     // 130, 9
180     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getMemstoreSize())), jamonWriter);
181     // 130, 68
182     jamonWriter.write("</td>\n</tr>\n</table>\n");
183   }
184   
185   
186   // 71, 1
187   private void __jamon_innerUnit__baseStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
188     throws java.io.IOException
189   {
190     // 75, 1
191     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>");
192     // 85, 13
193     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
194     // 85, 70
195     jamonWriter.write("</td>\n        <td>");
196     // 86, 13
197     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
198     // 86, 46
199     jamonWriter.write("</td>\n        <td>");
200     // 87, 13
201     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
202     // 87, 46
203     jamonWriter.write("</td>\n        <td>");
204     // 88, 13
205     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocalSecondaryRegions()), jamonWriter);
206     // 88, 62
207     jamonWriter.write("</td>\n        <td>");
208     // 89, 13
209     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(0), jamonWriter);
210     // 89, 20
211     jamonWriter.write("</td>\n    </tr>\n</table>\n");
212   }
213   
214   
215   // 135, 1
216   private void __jamon_innerUnit__walStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
217     throws java.io.IOException
218   {
219     // 139, 1
220     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>");
221     // 147, 9
222     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter);
223     // 147, 37
224     jamonWriter.write("</td>\n    <td>");
225     // 148, 9
226     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWALFileSize()), jamonWriter);
227     // 148, 37
228     jamonWriter.write("</td>\n</tr>\n</table>\n");
229   }
230   
231   
232   // 153, 1
233   private void __jamon_innerUnit__storeStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
234     throws java.io.IOException
235   {
236     // 157, 1
237     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>");
238     // 167, 9
239     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStores())), jamonWriter);
240     // 167, 65
241     jamonWriter.write("</td>\n    <td>");
242     // 168, 9
243     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStoreFiles())), jamonWriter);
244     // 168, 69
245     jamonWriter.write("</td>\n    <td>");
246     // 169, 9
247     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize())), jamonWriter);
248     // 169, 74
249     jamonWriter.write("</td>\n    <td>");
250     // 170, 9
251     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize())), jamonWriter);
252     // 170, 76
253     jamonWriter.write("</td>\n    <td>");
254     // 171, 9
255     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize())), jamonWriter);
256     // 171, 76
257     jamonWriter.write("</td>\n</tr>\n</table>\n");
258   }
259   
260   
261 }