View Javadoc

1   // Autogenerated Jamon implementation
2   // /Users/stack/checkouts/hbase.git/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.yammer.metrics.stats.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   // 144, 1
106   private void __jamon_innerUnit__storeStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
107     throws java.io.IOException
108   {
109     // 148, 1
110     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>");
111     // 158, 9
112     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStores())), jamonWriter);
113     // 158, 65
114     jamonWriter.write("</td>\n    <td>");
115     // 159, 9
116     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getNumStoreFiles())), jamonWriter);
117     // 159, 69
118     jamonWriter.write("</td>\n    <td>");
119     // 160, 9
120     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize())), jamonWriter);
121     // 160, 74
122     jamonWriter.write("</td>\n    <td>");
123     // 161, 9
124     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize())), jamonWriter);
125     // 161, 76
126     jamonWriter.write("</td>\n    <td>");
127     // 162, 9
128     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize())), jamonWriter);
129     // 162, 76
130     jamonWriter.write("</td>\n</tr>\n</table>\n");
131   }
132   
133   
134   // 168, 1
135   private void __jamon_innerUnit__requestStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
136     throws java.io.IOException
137   {
138     // 172, 1
139     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>");
140     // 179, 9
141     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
142     // 179, 66
143     jamonWriter.write("</td>\n    <td>");
144     // 180, 9
145     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getReadRequestsCount()), jamonWriter);
146     // 180, 43
147     jamonWriter.write("</td>\n    <td>");
148     // 181, 9
149     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWriteRequestsCount()), jamonWriter);
150     // 181, 44
151     jamonWriter.write("</td>\n</tr>\n</table>\n");
152   }
153   
154   
155   // 94, 1
156   private void __jamon_innerUnit__memoryStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
157     throws java.io.IOException
158   {
159     // 98, 1
160     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        ");
161     // 110, 9
162     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed())), jamonWriter);
163     // 110, 111
164     jamonWriter.write("\n    </td>\n    <td>\n        ");
165     // 113, 9
166     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax())), jamonWriter);
167     // 113, 110
168     jamonWriter.write("\n    </td>\n    <td>\n        ");
169     // 116, 9
170     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage())), jamonWriter);
171     // 116, 85
172     jamonWriter.write("\n    </td>\n    <td>\n        ");
173     // 119, 9
174     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize())), jamonWriter);
175     // 119, 84
176     jamonWriter.write("\n    </td>\n    <td>");
177     // 121, 9
178     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.humanReadableInt(mWrap.getMemstoreSize())), jamonWriter);
179     // 121, 68
180     jamonWriter.write("</td>\n</tr>\n</table>\n");
181   }
182   
183   
184   // 126, 1
185   private void __jamon_innerUnit__walStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
186     throws java.io.IOException
187   {
188     // 130, 1
189     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>");
190     // 138, 9
191     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumWALFiles()), jamonWriter);
192     // 138, 37
193     jamonWriter.write("</td>\n    <td>");
194     // 139, 9
195     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getWALFileSize()), jamonWriter);
196     // 139, 37
197     jamonWriter.write("</td>\n</tr>\n</table>\n");
198   }
199   
200   
201   // 71, 1
202   private void __jamon_innerUnit__baseStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap)
203     throws java.io.IOException
204   {
205     // 75, 1
206     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>");
207     // 85, 13
208     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%.0f", mWrap.getRequestsPerSecond())), jamonWriter);
209     // 85, 70
210     jamonWriter.write("</td>\n        <td>");
211     // 86, 13
212     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getNumOnlineRegions()), jamonWriter);
213     // 86, 46
214     jamonWriter.write("</td>\n        <td>");
215     // 87, 13
216     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocal()), jamonWriter);
217     // 87, 46
218     jamonWriter.write("</td>\n        <td>");
219     // 88, 13
220     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getPercentFileLocalSecondaryRegions()), jamonWriter);
221     // 88, 62
222     jamonWriter.write("</td>\n        <td>");
223     // 89, 13
224     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(0), jamonWriter);
225     // 89, 20
226     jamonWriter.write("</td>\n    </tr>\n</table>\n");
227   }
228   
229   
230   // 186, 1
231   private void __jamon_innerUnit__queueStats(final java.io.Writer jamonWriter, final MetricsRegionServerWrapper mWrap, final MetricsHBaseServerWrapper mServerWrap)
232     throws java.io.IOException
233   {
234     // 191, 1
235     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>");
236     // 199, 9
237     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getCompactionQueueSize()), jamonWriter);
238     // 199, 45
239     jamonWriter.write("</td>\n    <td>");
240     // 200, 9
241     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(mWrap.getFlushQueueSize()), jamonWriter);
242     // 200, 40
243     jamonWriter.write("</td>\n    <td>");
244     // 201, 9
245     org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(StringUtils.TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(),
246       "", 1)), jamonWriter);
247     // 202, 16
248     jamonWriter.write("</td>\n</tr>\n</table>\n");
249   }
250   
251   
252 }