View Javadoc

1   // Autogenerated Jamon implementation
2   // /home/stack/trunk/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.metrics.histogram.MetricsHistogram;
28  // 34, 1
29  import org.apache.hadoop.hbase.util.DirectMemoryUtils;
30  // 35, 1
31  import org.apache.hadoop.util.StringUtils;
32  // 36, 1
33  import com.yammer.metrics.stats.Snapshot;
34  // 37, 1
35  import java.lang.management.ManagementFactory;
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    protected static org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
44    {
45      return p_implData;
46    }
47    public ServerMetricsTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
48    {
49      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
50      mWrap = p_implData.getMWrap();
51    }
52    
53    public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
54      throws java.io.IOException
55    {
56      // 39, 1
57      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\">hlogs</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_blockCacheStats\" data-toggle=\"tab\">Block Cache</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            ");
58      // 51, 13
59      {
60        // 51, 13
61        __jamon_innerUnit__baseStats(jamonWriter, mWrap );
62      }
63      // 51, 43
64      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_memoryStats\">\n            ");
65      // 54, 13
66      {
67        // 54, 13
68        __jamon_innerUnit__memoryStats(jamonWriter, mWrap );
69      }
70      // 54, 45
71      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_requestStats\">\n            ");
72      // 57, 13
73      {
74        // 57, 13
75        __jamon_innerUnit__requestStats(jamonWriter, mWrap );
76      }
77      // 57, 46
78      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_hlogStats\">\n            ");
79      // 60, 13
80      {
81        // 60, 13
82        __jamon_innerUnit__hlogStats(jamonWriter, mWrap );
83      }
84      // 60, 43
85      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_storeStats\">\n            ");
86      // 63, 13
87      {
88        // 63, 13
89        __jamon_innerUnit__storeStats(jamonWriter, mWrap );
90      }
91      // 63, 44
92      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_queueStats\">\n            ");
93      // 66, 13
94      {
95        // 66, 13
96        __jamon_innerUnit__queueStats(jamonWriter, mWrap  );
97      }
98      // 66, 45
99      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_blockCacheStats\">\n            ");
100     // 69, 13
101     {
102       // 69, 13
103       __jamon_innerUnit__blockCacheStats(jamonWriter, mWrap );
104     }
105     // 69, 49
106     jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
107   }
108   
109   
110   // 169, 1
111   private void __jamon_innerUnit__requestStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
112     throws java.io.IOException
113   {
114     // 173, 1
115     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>");
116     // 180, 9
117     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
118     // 180, 66
119     jamonWriter.write("</td>\n    <td>");
120     // 181, 9
121     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
122     // 181, 43
123     jamonWriter.write("</td>\n    <td>");
124     // 182, 9
125     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
126     // 182, 44
127     jamonWriter.write("</td>\n</tr>\n</table>\n");
128   }
129   
130   
131   // 187, 1
132   private void __jamon_innerUnit__queueStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
133     throws java.io.IOException
134   {
135     // 191, 1
136     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>");
137     // 198, 9
138     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
139     // 198, 45
140     jamonWriter.write("</td>\n    <td>");
141     // 199, 9
142     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
143     // 199, 40
144     jamonWriter.write("</td>\n</tr>\n</table>\n");
145   }
146   
147   
148   // 205, 1
149   private void __jamon_innerUnit__blockCacheStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
150     throws java.io.IOException
151   {
152     // 209, 1
153     jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n    <th>Cache Size (bytes)</th>\n    <th>Cache Free (bytes)</th>\n    <th>Cache Count (blocks)</th>\n    <th>Cache Hit Count</th>\n    <th>Cache Miss Count</th>\n    <th>Cache Hit Ratio</th>\n    <th>Cache Eviction Count</th>\n\n</tr>\n<tr>\n    <td>");
154     // 221, 9
155     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheSize())), jamonWriter);
156     // 221, 70
157     jamonWriter.write("</td>\n    <td>");
158     // 222, 9
159     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheFreeSize())), jamonWriter);
160     // 222, 74
161     jamonWriter.write("</td>\n    <td>");
162     // 223, 9
163     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheCount())), jamonWriter);
164     // 223, 71
165     jamonWriter.write("</td>\n    <td>");
166     // 224, 9
167     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheHitCount())), jamonWriter);
168     // 224, 74
169     jamonWriter.write("</td>\n    <td>");
170     // 225, 9
171     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheMissCount())), jamonWriter);
172     // 225, 75
173     jamonWriter.write("</td>\n    <td>");
174     // 226, 9
175     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getBlockCacheHitPercent()), jamonWriter);
176     // 226, 46
177     jamonWriter.write("%</td>\n    <td>");
178     // 227, 9
179     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getBlockCacheEvictedCount())), jamonWriter);
180     // 227, 78
181     jamonWriter.write("</td>\n</tr>\n</table>\n");
182   }
183   
184   
185   // 127, 1
186   private void __jamon_innerUnit__hlogStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
187     throws java.io.IOException
188   {
189     // 131, 1
190     jamonWriter.write("<table class=\"table table-striped\">\n<tr>\n    <tr>\n        <th>Num. HLog Files</th>\n        <th>Size. HLog Files (bytes)</th>\n    </tr>\n</tr>\n<tr>\n    <td>");
191     // 139, 9
192     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumHLogFiles()), jamonWriter);
193     // 139, 38
194     jamonWriter.write("</td>\n    <td>");
195     // 140, 9
196     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getHLogFileSize()), jamonWriter);
197     // 140, 38
198     jamonWriter.write("</td>\n</tr>\n</table>\n");
199   }
200   
201   
202   // 95, 1
203   private void __jamon_innerUnit__memoryStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
204     throws java.io.IOException
205   {
206     // 99, 1
207     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        ");
208     // 111, 9
209     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed())), jamonWriter);
210     // 111, 111
211     jamonWriter.write("\n    </td>\n    <td>\n        ");
212     // 114, 9
213     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax())), jamonWriter);
214     // 114, 110
215     jamonWriter.write("\n    </td>\n    <td>\n        ");
216     // 117, 9
217     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage())), jamonWriter);
218     // 117, 85
219     jamonWriter.write("\n    </td>\n    <td>\n        ");
220     // 120, 9
221     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize())), jamonWriter);
222     // 120, 84
223     jamonWriter.write("\n    </td>\n    <td>");
224     // 122, 9
225     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getMemstoreSize())), jamonWriter);
226     // 122, 68
227     jamonWriter.write("</td>\n</tr>\n</table>\n");
228   }
229   
230   
231   // 74, 1
232   private void __jamon_innerUnit__baseStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
233     throws java.io.IOException
234   {
235     // 78, 1
236     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 HLog Append Count</th>\n    </tr>\n    <tr>\n        <td>");
237     // 87, 13
238     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
239     // 87, 70
240     jamonWriter.write("</td>\n        <td>");
241     // 88, 13
242     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
243     // 88, 46
244     jamonWriter.write("</td>\n        <td>");
245     // 89, 13
246     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
247     // 89, 46
248     jamonWriter.write("</td>\n        <td>");
249     // 90, 13
250     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(0), jamonWriter);
251     // 90, 20
252     jamonWriter.write("</td>\n    </tr>\n</table>\n");
253   }
254   
255   
256   // 145, 1
257   private void __jamon_innerUnit__storeStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
258     throws java.io.IOException
259   {
260     // 149, 1
261     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>");
262     // 159, 9
263     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStores())), jamonWriter);
264     // 159, 65
265     jamonWriter.write("</td>\n    <td>");
266     // 160, 9
267     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStoreFiles())), jamonWriter);
268     // 160, 69
269     jamonWriter.write("</td>\n    <td>");
270     // 161, 9
271     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize())), jamonWriter);
272     // 161, 74
273     jamonWriter.write("</td>\n    <td>");
274     // 162, 9
275     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize())), jamonWriter);
276     // 162, 76
277     jamonWriter.write("</td>\n    <td>");
278     // 163, 9
279     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize())), jamonWriter);
280     // 163, 76
281     jamonWriter.write("</td>\n</tr>\n</table>\n");
282   }
283   
284   
285 }