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.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    </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      // 50, 13
59      {
60        // 50, 13
61        __jamon_innerUnit__baseStats(jamonWriter, mWrap );
62      }
63      // 50, 43
64      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_memoryStats\">\n            ");
65      // 53, 13
66      {
67        // 53, 13
68        __jamon_innerUnit__memoryStats(jamonWriter, mWrap );
69      }
70      // 53, 45
71      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_requestStats\">\n            ");
72      // 56, 13
73      {
74        // 56, 13
75        __jamon_innerUnit__requestStats(jamonWriter, mWrap );
76      }
77      // 56, 46
78      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_hlogStats\">\n            ");
79      // 59, 13
80      {
81        // 59, 13
82        __jamon_innerUnit__hlogStats(jamonWriter, mWrap );
83      }
84      // 59, 43
85      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_storeStats\">\n            ");
86      // 62, 13
87      {
88        // 62, 13
89        __jamon_innerUnit__storeStats(jamonWriter, mWrap );
90      }
91      // 62, 44
92      jamonWriter.write("\n        </div>\n        <div class=\"tab-pane\" id=\"tab_queueStats\">\n            ");
93      // 65, 13
94      {
95        // 65, 13
96        __jamon_innerUnit__queueStats(jamonWriter, mWrap  );
97      }
98      // 65, 45
99      jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
100   }
101   
102   
103   // 165, 1
104   private void __jamon_innerUnit__requestStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
105     throws java.io.IOException
106   {
107     // 169, 1
108     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>");
109     // 176, 9
110     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
111     // 176, 66
112     jamonWriter.write("</td>\n    <td>");
113     // 177, 9
114     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
115     // 177, 43
116     jamonWriter.write("</td>\n    <td>");
117     // 178, 9
118     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
119     // 178, 44
120     jamonWriter.write("</td>\n</tr>\n</table>\n");
121   }
122   
123   
124   // 183, 1
125   private void __jamon_innerUnit__queueStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
126     throws java.io.IOException
127   {
128     // 187, 1
129     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>");
130     // 194, 9
131     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
132     // 194, 45
133     jamonWriter.write("</td>\n    <td>");
134     // 195, 9
135     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
136     // 195, 40
137     jamonWriter.write("</td>\n</tr>\n</table>\n");
138   }
139   
140   
141   // 123, 1
142   private void __jamon_innerUnit__hlogStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
143     throws java.io.IOException
144   {
145     // 127, 1
146     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>");
147     // 135, 9
148     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumHLogFiles()), jamonWriter);
149     // 135, 38
150     jamonWriter.write("</td>\n    <td>");
151     // 136, 9
152     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getHLogFileSize()), jamonWriter);
153     // 136, 38
154     jamonWriter.write("</td>\n</tr>\n</table>\n");
155   }
156   
157   
158   // 91, 1
159   private void __jamon_innerUnit__memoryStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
160     throws java.io.IOException
161   {
162     // 95, 1
163     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        ");
164     // 107, 9
165     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed())), jamonWriter);
166     // 107, 111
167     jamonWriter.write("\n    </td>\n    <td>\n        ");
168     // 110, 9
169     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax())), jamonWriter);
170     // 110, 110
171     jamonWriter.write("\n    </td>\n    <td>\n        ");
172     // 113, 9
173     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage())), jamonWriter);
174     // 113, 85
175     jamonWriter.write("\n    </td>\n    <td>\n        ");
176     // 116, 9
177     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize())), jamonWriter);
178     // 116, 84
179     jamonWriter.write("\n    </td>\n    <td>");
180     // 118, 9
181     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getMemstoreSize())), jamonWriter);
182     // 118, 68
183     jamonWriter.write("</td>\n</tr>\n</table>\n");
184   }
185   
186   
187   // 70, 1
188   private void __jamon_innerUnit__baseStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
189     throws java.io.IOException
190   {
191     // 74, 1
192     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>");
193     // 83, 13
194     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
195     // 83, 70
196     jamonWriter.write("</td>\n        <td>");
197     // 84, 13
198     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
199     // 84, 46
200     jamonWriter.write("</td>\n        <td>");
201     // 85, 13
202     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
203     // 85, 46
204     jamonWriter.write("</td>\n        <td>");
205     // 86, 13
206     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(0), jamonWriter);
207     // 86, 20
208     jamonWriter.write("</td>\n    </tr>\n</table>\n");
209   }
210   
211   
212   // 141, 1
213   private void __jamon_innerUnit__storeStats(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
214     throws java.io.IOException
215   {
216     // 145, 1
217     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>");
218     // 155, 9
219     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStores())), jamonWriter);
220     // 155, 65
221     jamonWriter.write("</td>\n    <td>");
222     // 156, 9
223     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStoreFiles())), jamonWriter);
224     // 156, 69
225     jamonWriter.write("</td>\n    <td>");
226     // 157, 9
227     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize())), jamonWriter);
228     // 157, 74
229     jamonWriter.write("</td>\n    <td>");
230     // 158, 9
231     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize())), jamonWriter);
232     // 158, 76
233     jamonWriter.write("</td>\n    <td>");
234     // 159, 9
235     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize())), jamonWriter);
236     // 159, 76
237     jamonWriter.write("</td>\n</tr>\n</table>\n");
238   }
239   
240   
241 }