1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.apache.hadoop.hbase.regionserver;
20
21 /**
22 * This is the interface that will expose RegionServer information to hadoop1/hadoop2
23 * implementations of the MetricsRegionServerSource.
24 */
25 public interface MetricsRegionServerWrapper {
26
27 /**
28 * Get ServerName
29 */
30 String getServerName();
31
32 /**
33 * Get the Cluster ID
34 *
35 * @return Cluster ID
36 */
37 String getClusterId();
38
39 /**
40 * Get the Zookeeper Quorum Info
41 *
42 * @return Zookeeper Quorum Info
43 */
44 String getZookeeperQuorum();
45
46 /**
47 * Get the co-processors
48 *
49 * @return Co-processors
50 */
51 String getCoprocessors();
52
53 /**
54 * Get HRegionServer start time
55 *
56 * @return Start time of RegionServer in milliseconds
57 */
58 long getStartCode();
59
60 /**
61 * The number of online regions
62 */
63 long getNumOnlineRegions();
64
65 /**
66 * Get the number of stores hosted on this region server.
67 */
68 long getNumStores();
69
70 /**
71 * Get the number of WAL files of this region server.
72 */
73 public long getNumWALFiles();
74
75 /**
76 * Get the size of WAL files of this region server.
77 */
78 public long getWALFileSize();
79
80 /**
81 * Get the number of store files hosted on this region server.
82 */
83 long getNumStoreFiles();
84
85 /**
86 * Get the size of the memstore on this region server.
87 */
88 long getMemstoreSize();
89
90 /**
91 * Get the total size of the store files this region server is serving from.
92 */
93 long getStoreFileSize();
94
95 /**
96 * Get the number of requests per second.
97 */
98 double getRequestsPerSecond();
99
100 /**
101 * Get the total number of requests per second.
102 */
103 long getTotalRequestCount();
104
105 /**
106 * Get the number of read requests to regions hosted on this region server.
107 */
108 long getReadRequestsCount();
109
110 /**
111 * Get the number of write requests to regions hosted on this region server.
112 */
113 long getWriteRequestsCount();
114
115 /**
116 * Get the number of CAS operations that failed.
117 */
118 long getCheckAndMutateChecksFailed();
119
120 /**
121 * Get the number of CAS operations that passed.
122 */
123 long getCheckAndMutateChecksPassed();
124
125 /**
126 * Get the Size (in bytes) of indexes in storefiles on disk.
127 */
128 long getStoreFileIndexSize();
129
130 /**
131 * Get the size (in bytes) of of the static indexes including the roots.
132 */
133 long getTotalStaticIndexSize();
134
135 /**
136 * Get the size (in bytes) of the static bloom filters.
137 */
138 long getTotalStaticBloomSize();
139
140 /**
141 * Number of mutations received with WAL explicitly turned off.
142 */
143 long getNumMutationsWithoutWAL();
144
145 /**
146 * Ammount of data in the memstore but not in the WAL because mutations explicitly had their
147 * WAL turned off.
148 */
149 long getDataInMemoryWithoutWAL();
150
151 /**
152 * Get the percent of HFiles' that are local.
153 */
154 double getPercentFileLocal();
155
156 /**
157 * Get the percent of HFiles' that are local for secondary region replicas.
158 */
159 double getPercentFileLocalSecondaryRegions();
160
161 /**
162 * Get the size of the split queue
163 */
164 int getSplitQueueSize();
165
166 /**
167 * Get the size of the compaction queue
168 */
169 int getCompactionQueueSize();
170
171 int getSmallCompactionQueueSize();
172
173 int getLargeCompactionQueueSize();
174
175 /**
176 * Get the size of the flush queue.
177 */
178 int getFlushQueueSize();
179
180 /**
181 * Get the size (in bytes) of the block cache that is free.
182 */
183 long getBlockCacheFreeSize();
184
185 /**
186 * Get the number of items in the block cache.
187 */
188 long getBlockCacheCount();
189
190 /**
191 * Get the total size (in bytes) of the block cache.
192 */
193 long getBlockCacheSize();
194
195 /**
196 * Get the count of hits to the block cache
197 */
198 long getBlockCacheHitCount();
199
200 /**
201 * Get the count of hits to primary replica in the block cache
202 */
203 long getBlockCachePrimaryHitCount();
204
205 /**
206 * Get the count of misses to the block cache.
207 */
208 long getBlockCacheMissCount();
209
210 /**
211 * Get the count of misses to primary replica in the block cache.
212 */
213 long getBlockCachePrimaryMissCount();
214
215 /**
216 * Get the number of items evicted from the block cache.
217 */
218 long getBlockCacheEvictedCount();
219
220 /**
221 * Get the number of items evicted from primary replica in the block cache.
222 */
223 long getBlockCachePrimaryEvictedCount();
224
225
226 /**
227 * Get the percent of all requests that hit the block cache.
228 */
229 double getBlockCacheHitPercent();
230
231 /**
232 * Get the percent of all requests that hit the block cache.
233 */
234 int getBlockHitPercent();
235
236 /**
237 * Get the percent of requests with the block cache turned on that hit the block cache.
238 */
239 double getBlockCacheHitCachingPercent();
240
241 /**
242 * Number of cache insertions that failed.
243 */
244 long getBlockCacheFailedInsertions();
245
246 /**
247 * Force a re-computation of the metrics.
248 */
249 void forceRecompute();
250
251 /**
252 * Get the amount of time that updates were blocked.
253 */
254 long getUpdatesBlockedTime();
255
256 /**
257 * Get the number of cells flushed to disk.
258 */
259 long getFlushedCellsCount();
260
261 /**
262 * Get the number of cells processed during minor compactions.
263 */
264 long getCompactedCellsCount();
265
266 /**
267 * Get the number of cells processed during major compactions.
268 */
269 long getMajorCompactedCellsCount();
270
271 /**
272 * Get the total amount of data flushed to disk, in bytes.
273 */
274 long getFlushedCellsSize();
275
276 /**
277 * Get the total amount of data processed during minor compactions, in bytes.
278 */
279 long getCompactedCellsSize();
280
281 /**
282 * Get the total amount of data processed during major compactions, in bytes.
283 */
284 long getMajorCompactedCellsSize();
285
286 /**
287 * @return Count of requests blocked because the memstore size is larger than blockingMemStoreSize
288 */
289 public long getBlockedRequestsCount();
290
291 /**
292 * @return Count of hedged read operations
293 */
294 public long getHedgedReadOps();
295
296 /**
297 * @return Count of times a hedged read beat out the primary read.
298 */
299 public long getHedgedReadWins();
300
301 /*
302 * Gets the number of cells move to mob during compaction.
303 */
304 long getMobCompactedIntoMobCellsCount();
305
306 /**
307 * Gets the number of cells move from mob during compaction.
308 */
309 long getMobCompactedFromMobCellsCount();
310
311 /**
312 * Gets the total amount of cells move to mob during compaction, in bytes.
313 */
314 long getMobCompactedIntoMobCellsSize();
315
316 /**
317 * Gets the total amount of cells move from mob during compaction, in bytes.
318 */
319 long getMobCompactedFromMobCellsSize();
320
321 /**
322 * Gets the number of the flushes in mob-enabled stores.
323 */
324 long getMobFlushCount();
325
326 /**
327 * Gets the number of mob cells flushed to disk.
328 */
329 long getMobFlushedCellsCount();
330
331 /**
332 * Gets the total amount of mob cells flushed to disk, in bytes.
333 */
334 long getMobFlushedCellsSize();
335
336 /**
337 * Gets the number of scanned mob cells.
338 */
339 long getMobScanCellsCount();
340
341 /**
342 * Gets the total amount of scanned mob cells, in bytes.
343 */
344 long getMobScanCellsSize();
345
346 /**
347 * Gets the count of accesses to the mob file cache.
348 */
349 long getMobFileCacheAccessCount();
350
351 /**
352 * Gets the count of misses to the mob file cache.
353 */
354 long getMobFileCacheMissCount();
355
356 /**
357 * Gets the number of items evicted from the mob file cache.
358 */
359 long getMobFileCacheEvictedCount();
360
361 /**
362 * Gets the count of cached mob files.
363 */
364 long getMobFileCacheCount();
365
366 /**
367 * Gets the hit percent to the mob file cache.
368 */
369 int getMobFileCacheHitPercent();
370 }