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