View Javadoc

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