View Javadoc

1   // Autogenerated Jamon implementation
2   // /home/jenkins/jenkins-slave/workspace/hbase_generate_website/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   // 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.TraditionalBinaryPrefix;
32  // 37, 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    private final MetricsHBaseServerWrapper mServerWrap;
42    protected static org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
43    {
44      return p_implData;
45    }
46    public ServerMetricsTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.ServerMetricsTmpl.ImplData p_implData)
47    {
48      super(p_templateManager, __jamon_setOptionalArguments(p_implData));
49      mWrap = p_implData.getMWrap();
50      mServerWrap = p_implData.getMServerWrap();
51    }
52    
53    @Override public void renderNoFlush(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_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            ");
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_walStats\">\n            ");
79      // 59, 13
80      {
81        // 59, 13
82        __jamon_innerUnit__walStats(jamonWriter, mWrap );
83      }
84      // 59, 42
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, mServerWrap);
97      }
98      // 65, 72
99      jamonWriter.write("\n        </div>\n    </div>\n</div>\n\n");
100   }
101   
102   
103   // 145, 1
104   private void __jamon_innerUnit__storeStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
105     throws java.io.IOException
106   {
107     // 149, 1
108     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>");
109     // 159, 9
110     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStores()), jamonWriter);
111     // 159, 35
112     jamonWriter.write("</td>\n    <td>");
113     // 160, 9
114     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumStoreFiles()), jamonWriter);
115     // 160, 39
116     jamonWriter.write("</td>\n    <td>");
117     // 161, 9
118     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getStoreFileIndexSize(), "B", 1)), jamonWriter);
119     // 161, 89
120     jamonWriter.write("</td>\n    <td>");
121     // 162, 9
122     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticIndexSize(), "B", 1)), jamonWriter);
123     // 162, 91
124     jamonWriter.write("</td>\n    <td>");
125     // 163, 9
126     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticBloomSize(), "B", 1)), jamonWriter);
127     // 163, 91
128     jamonWriter.write("</td>\n</tr>\n</table>\n");
129   }
130
131
132   // 169, 1
133   private void __jamon_innerUnit__requestStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
134     throws java.io.IOException
135   {
136     // 173, 1
137     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>");
138     // 181, 9
139     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
140     // 181, 66
141     jamonWriter.write("</td>\n    <td>");
142     // 182, 9
143     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
144     // 182, 43
145     jamonWriter.write("</td>\n    <td>");
146     // 183, 9
147     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFilteredReadRequestsCount()), jamonWriter);
148     // 183, 51
149     jamonWriter.write("</td>\n    <td>");
150     // 184, 9
151     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
152     // 184, 44
153     jamonWriter.write("</td>\n</tr>\n</table>\n");
154   }
155
156
157   // 93, 1
158   private void __jamon_innerUnit__memoryStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
159     throws java.io.IOException
160   {
161     // 97, 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     // 109, 9
164     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(
165             ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed(), "B", 1)), jamonWriter);
166     // 110, 91
167     jamonWriter.write("\n    </td>\n    <td>\n        ");
168     // 113, 9
169     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(
170             ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax(), "B", 1)), jamonWriter);
171     // 114, 90
172     jamonWriter.write("\n    </td>\n    <td>\n        ");
173     // 117, 9
174     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemoryUsage(), "B", 1)), jamonWriter);
175     // 117, 100
176     jamonWriter.write("\n    </td>\n    <td>\n        ");
177     // 120, 9
178     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(), "B", 1)), jamonWriter);
179     // 120, 99
180     jamonWriter.write("\n    </td>\n    <td>");
181     // 122, 9
182     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1)), jamonWriter);
183     // 122, 83
184     jamonWriter.write("</td>\n</tr>\n</table>\n");
185   }
186
187
188   // 127, 1
189   private void __jamon_innerUnit__walStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
190     throws java.io.IOException
191   {
192     // 131, 1
193     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>");
194     // 139, 9
195     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter);
196     // 139, 37
197     jamonWriter.write("</td>\n    <td>");
198     // 140, 9
199     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mWrap.getWALFileSize(), "B", 1)), jamonWriter);
200     // 140, 82
201     jamonWriter.write("</td>\n</tr>\n</table>\n");
202   }
203
204
205   // 70, 1
206   private void __jamon_innerUnit__baseStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
207     throws java.io.IOException
208   {
209     // 74, 1
210     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>");
211     // 84, 13
212     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
213     // 84, 70
214     jamonWriter.write("</td>\n        <td>");
215     // 85, 13
216     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
217     // 85, 46
218     jamonWriter.write("</td>\n        <td>");
219     // 86, 13
220     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
221     // 86, 46
222     jamonWriter.write("</td>\n        <td>");
223     // 87, 13
224     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocalSecondaryRegions()), jamonWriter);
225     // 87, 62
226     jamonWriter.write("</td>\n        <td>");
227     // 88, 13
228     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALSlowAppend()), jamonWriter);
229     // 88, 46
230     jamonWriter.write("</td>\n    </tr>\n</table>\n");
231   }
232
233
234   // 189, 1
235   private void __jamon_innerUnit__queueStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap, final MetricsHBaseServerWrapper mServerWrap)
236     throws java.io.IOException
237   {
238     // 194, 1
239     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 (bytes)</th>\n\n</tr>\n<tr>\n    <td>");
240     // 205, 9
241     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
242     // 205, 45
243     jamonWriter.write("</td>\n    <td>");
244     // 206, 9
245     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
246     // 206, 40
247     jamonWriter.write("</td>\n    <td>");
248     // 207, 9
249     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getPriorityQueueLength()), jamonWriter);
250     // 207, 51
251     jamonWriter.write("</td>\n    <td>");
252     // 208, 9
253     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getGeneralQueueLength()), jamonWriter);
254     // 208, 50
255     jamonWriter.write("</td>\n    <td>");
256     // 209, 9
257     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mServerWrap.getReplicationQueueLength()), jamonWriter);
258     // 209, 54
259     jamonWriter.write("</td>\n    <td>");
260     // 210, 9
261     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(), "B", 1)), jamonWriter);
262     // 210, 91
263     jamonWriter.write("</td>\n</tr>\n</table>\n");
264   }
265
266
267 }