View Javadoc

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