View Javadoc

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  import org.apache.hadoop.hbase.metrics.BaseSource;
22  
23  /**
24   * Interface for classes that expose metrics about the regionserver.
25   */
26  public interface MetricsRegionServerSource extends BaseSource {
27  
28    /**
29     * The name of the metrics
30     */
31    String METRICS_NAME = "Server";
32  
33    /**
34     * The name of the metrics context that metrics will be under.
35     */
36    String METRICS_CONTEXT = "regionserver";
37  
38    /**
39     * Description
40     */
41    String METRICS_DESCRIPTION = "Metrics about HBase RegionServer";
42  
43    /**
44     * The name of the metrics context that metrics will be under in jmx
45     */
46    String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
47  
48    /**
49     * Update the Put time histogram
50     *
51     * @param t time it took
52     */
53    void updatePut(long t);
54  
55    /**
56     * Update the Delete time histogram
57     *
58     * @param t time it took
59     */
60    void updateDelete(long t);
61  
62    /**
63     * Update the Get time histogram .
64     *
65     * @param t time it took
66     */
67    void updateGet(long t);
68  
69    /**
70     * Update the Increment time histogram.
71     *
72     * @param t time it took
73     */
74    void updateIncrement(long t);
75  
76    /**
77     * Update the Append time histogram.
78     *
79     * @param t time it took
80     */
81    void updateAppend(long t);
82  
83    /**
84     * Update the Replay time histogram.
85     *
86     * @param t time it took
87     */
88    void updateReplay(long t);
89  
90    /**
91     * Update the scan size.
92     *
93     * @param scanSize size of the scan
94     */
95    void updateScanSize(long scanSize);
96  
97    /**
98     * Update the scan time.
99     * */
100   void updateScanTime(long t);
101 
102   /**
103    * Increment the number of slow Puts that have happened.
104    */
105   void incrSlowPut();
106 
107   /**
108    * Increment the number of slow Deletes that have happened.
109    */
110   void incrSlowDelete();
111 
112   /**
113    * Increment the number of slow Gets that have happened.
114    */
115   void incrSlowGet();
116 
117   /**
118    * Increment the number of slow Increments that have happened.
119    */
120   void incrSlowIncrement();
121 
122   /**
123    * Increment the number of slow Appends that have happened.
124    */
125   void incrSlowAppend();
126 
127   /**
128    * Update the split transaction time histogram
129    * @param t time it took, in milliseconds
130    */
131   void updateSplitTime(long t);
132 
133   /**
134    * Increment number of a requested splits
135    */
136   void incrSplitRequest();
137 
138   /**
139    * Increment number of successful splits
140    */
141   void incrSplitSuccess();
142 
143   /**
144    * Update the flush time histogram
145    * @param t time it took, in milliseconds
146    */
147   void updateFlushTime(long t);
148 
149   /**
150    * Update the flush memstore size histogram
151    * @param bytes the number of bytes in the memstore
152    */
153   void updateFlushMemstoreSize(long bytes);
154 
155   /**
156    * Update the flush output file size histogram
157    * @param bytes the number of bytes in the output file
158    */
159   void updateFlushOutputSize(long bytes);
160 
161   /**
162    * Update the compaction time histogram, both major and minor
163    * @param isMajor whether compaction is a major compaction
164    * @param t time it took, in milliseconds
165    */
166   void updateCompactionTime(boolean isMajor, long t);
167 
168   /**
169    * Update the compaction input number of files histogram
170    * @param isMajor whether compaction is a major compaction
171    * @param c number of files
172    */
173   void updateCompactionInputFileCount(boolean isMajor, long c);
174 
175   /**
176    * Update the compaction total input file size histogram
177    * @param isMajor whether compaction is a major compaction
178    * @param bytes the number of bytes of the compaction input file
179    */
180   void updateCompactionInputSize(boolean isMajor, long bytes);
181 
182   /**
183    * Update the compaction output number of files histogram
184    * @param isMajor whether compaction is a major compaction
185    * @param c number of files
186    */
187   void updateCompactionOutputFileCount(boolean isMajor, long c);
188 
189   /**
190    * Update the compaction total output file size
191    * @param isMajor whether compaction is a major compaction
192    * @param bytes the number of bytes of the compaction input file
193    */
194   void updateCompactionOutputSize(boolean isMajor, long bytes);
195 
196   // Strings used for exporting to metrics system.
197   String REGION_COUNT = "regionCount";
198   String REGION_COUNT_DESC = "Number of regions";
199   String STORE_COUNT = "storeCount";
200   String STORE_COUNT_DESC = "Number of Stores";
201   String WALFILE_COUNT = "hlogFileCount";
202   String WALFILE_COUNT_DESC = "Number of WAL Files";
203   String WALFILE_SIZE = "hlogFileSize";
204   String WALFILE_SIZE_DESC = "Size of all WAL Files";
205   String STOREFILE_COUNT = "storeFileCount";
206   String STOREFILE_COUNT_DESC = "Number of Store Files";
207   String MEMSTORE_SIZE = "memStoreSize";
208   String MEMSTORE_SIZE_DESC = "Size of the memstore";
209   String STOREFILE_SIZE = "storeFileSize";
210   String MAX_STORE_FILE_AGE = "maxStoreFileAge";
211   String MIN_STORE_FILE_AGE = "minStoreFileAge";
212   String AVG_STORE_FILE_AGE = "avgStoreFileAge";
213   String NUM_REFERENCE_FILES = "numReferenceFiles";
214   String MAX_STORE_FILE_AGE_DESC = "Max age of store files hosted on this region server";
215   String MIN_STORE_FILE_AGE_DESC = "Min age of store files hosted on this region server";
216   String AVG_STORE_FILE_AGE_DESC = "Average age of store files hosted on this region server";
217   String NUM_REFERENCE_FILES_DESC = "Number of reference file on this region server";
218   String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
219   String TOTAL_REQUEST_COUNT = "totalRequestCount";
220   String TOTAL_REQUEST_COUNT_DESC =
221       "Total number of requests this RegionServer has answered.";
222   String READ_REQUEST_COUNT = "readRequestCount";
223   String READ_REQUEST_COUNT_DESC =
224       "Number of read requests this region server has answered.";
225   String WRITE_REQUEST_COUNT = "writeRequestCount";
226   String WRITE_REQUEST_COUNT_DESC =
227       "Number of mutation requests this region server has answered.";
228   String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
229   String CHECK_MUTATE_FAILED_COUNT_DESC =
230       "Number of Check and Mutate calls that failed the checks.";
231   String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
232   String CHECK_MUTATE_PASSED_COUNT_DESC =
233       "Number of Check and Mutate calls that passed the checks.";
234   String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
235   String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
236   String STATIC_INDEX_SIZE = "staticIndexSize";
237   String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
238   String STATIC_BLOOM_SIZE = "staticBloomSize";
239   String STATIC_BLOOM_SIZE_DESC =
240       "Uncompressed size of the static bloom filters.";
241   String NUMBER_OF_MUTATIONS_WITHOUT_WAL = "mutationsWithoutWALCount";
242   String NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC =
243       "Number of mutations that have been sent by clients with the write ahead logging turned off.";
244   String DATA_SIZE_WITHOUT_WAL = "mutationsWithoutWALSize";
245   String DATA_SIZE_WITHOUT_WAL_DESC =
246       "Size of data that has been sent by clients with the write ahead logging turned off.";
247   String PERCENT_FILES_LOCAL = "percentFilesLocal";
248   String PERCENT_FILES_LOCAL_DESC =
249       "The percent of HFiles that are stored on the local hdfs data node.";
250   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS = "percentFilesLocalSecondaryRegions";
251   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS_DESC =
252     "The percent of HFiles used by secondary regions that are stored on the local hdfs data node.";
253   String SPLIT_QUEUE_LENGTH = "splitQueueLength";
254   String SPLIT_QUEUE_LENGTH_DESC = "Length of the queue for splits.";
255   String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
256   String LARGE_COMPACTION_QUEUE_LENGTH = "largeCompactionQueueLength";
257   String SMALL_COMPACTION_QUEUE_LENGTH = "smallCompactionQueueLength";
258   String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
259   String LARGE_COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions with input size "
260       + "larger than throttle threshold (2.5GB by default)";
261   String SMALL_COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions with input size "
262       + "smaller than throttle threshold (2.5GB by default)";
263   String FLUSH_QUEUE_LENGTH = "flushQueueLength";
264   String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
265   String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
266   String BLOCK_CACHE_FREE_DESC =
267       "Size of the block cache that is not occupied.";
268   String BLOCK_CACHE_COUNT = "blockCacheCount";
269   String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
270   String BLOCK_CACHE_SIZE = "blockCacheSize";
271   String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
272   String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
273   String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
274   String BLOCK_CACHE_PRIMARY_HIT_COUNT = "blockCacheHitCountPrimary";
275   String BLOCK_CACHE_PRIMARY_HIT_COUNT_DESC = "Count of hit on primary replica in the block cache.";
276   String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
277   String BLOCK_COUNT_MISS_COUNT_DESC =
278       "Number of requests for a block that missed the block cache.";
279   String BLOCK_CACHE_PRIMARY_MISS_COUNT = "blockCacheMissCountPrimary";
280   String BLOCK_COUNT_PRIMARY_MISS_COUNT_DESC =
281       "Number of requests for a block of primary replica that missed the block cache.";
282   String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
283   String BLOCK_CACHE_EVICTION_COUNT_DESC =
284       "Count of the number of blocks evicted from the block cache.";
285   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT = "blockCacheEvictionCountPrimary";
286   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT_DESC =
287       "Count of the number of blocks evicted from primary replica in the block cache.";
288   String BLOCK_CACHE_HIT_PERCENT = "blockCacheCountHitPercent";
289   String BLOCK_CACHE_HIT_PERCENT_DESC =
290       "Percent of block cache requests that are hits";
291   String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
292   String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
293       "The percent of the time that requests with the cache turned on hit the cache.";
294   String BLOCK_CACHE_FAILED_INSERTION_COUNT = "blockCacheFailedInsertionCount";
295   String BLOCK_CACHE_FAILED_INSERTION_COUNT_DESC = "Number of times that a block cache " +
296       "insertion failed. Usually due to size restrictions.";
297   String BLOCK_CACHE_DATA_MISS_COUNT = "blockCacheDataMissCount";
298   String BLOCK_CACHE_ENCODED_DATA_MISS_COUNT = "blockCacheEncodedDataMissCount";
299   String BLOCK_CACHE_LEAF_INDEX_MISS_COUNT = "blockCacheLeafIndexMissCount";
300   String BLOCK_CACHE_BLOOM_CHUNK_MISS_COUNT = "blockCacheBloomChunkMissCount";
301   String BLOCK_CACHE_META_MISS_COUNT = "blockCacheMetaMissCount";
302   String BLOCK_CACHE_ROOT_INDEX_MISS_COUNT = "blockCacheRootIndexMissCount";
303   String BLOCK_CACHE_INTERMEDIATE_INDEX_MISS_COUNT = "blockCacheIntermediateIndexMissCount";
304   String BLOCK_CACHE_FILE_INFO_MISS_COUNT = "blockCacheFileInfoMissCount";
305   String BLOCK_CACHE_GENERAL_BLOOM_META_MISS_COUNT = "blockCacheGeneralBloomMetaMissCount";
306   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_MISS_COUNT = "blockCacheDeleteFamilyBloomMissCount";
307   String BLOCK_CACHE_TRAILER_MISS_COUNT = "blockCacheTrailerMissCount";
308   String BLOCK_CACHE_DATA_HIT_COUNT = "blockCacheDataHitCount";
309   String BLOCK_CACHE_ENCODED_DATA_HIT_COUNT = "blockCacheEncodedDataHitCount";
310   String BLOCK_CACHE_LEAF_INDEX_HIT_COUNT = "blockCacheLeafIndexHitCount";
311   String BLOCK_CACHE_BLOOM_CHUNK_HIT_COUNT = "blockCacheBloomChunkHitCount";
312   String BLOCK_CACHE_META_HIT_COUNT = "blockCacheMetaHitCount";
313   String BLOCK_CACHE_ROOT_INDEX_HIT_COUNT = "blockCacheRootIndexHitCount";
314   String BLOCK_CACHE_INTERMEDIATE_INDEX_HIT_COUNT = "blockCacheIntermediateIndexHitCount";
315   String BLOCK_CACHE_FILE_INFO_HIT_COUNT = "blockCacheFileInfoHitCount";
316   String BLOCK_CACHE_GENERAL_BLOOM_META_HIT_COUNT = "blockCacheGeneralBloomMetaHitCount";
317   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_HIT_COUNT = "blockCacheDeleteFamilyBloomHitCount";
318   String BLOCK_CACHE_TRAILER_HIT_COUNT = "blockCacheTrailerHitCount";
319 
320   String RS_START_TIME_NAME = "regionServerStartTime";
321   String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
322   String SERVER_NAME_NAME = "serverName";
323   String CLUSTER_ID_NAME = "clusterId";
324   String RS_START_TIME_DESC = "RegionServer Start Time";
325   String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
326   String SERVER_NAME_DESC = "Server Name";
327   String CLUSTER_ID_DESC = "Cluster Id";
328   String UPDATES_BLOCKED_TIME = "updatesBlockedTime";
329   String UPDATES_BLOCKED_DESC =
330       "Number of MS updates have been blocked so that the memstore can be flushed.";
331   String DELETE_KEY = "delete";
332   String GET_SIZE_KEY = "getSize";
333   String GET_KEY = "get";
334   String INCREMENT_KEY = "increment";
335   String MUTATE_KEY = "mutate";
336   String APPEND_KEY = "append";
337   String REPLAY_KEY = "replay";
338   String SCAN_KEY = "scan";
339   String SCAN_SIZE_KEY = "scanSize";
340   String SCAN_TIME_KEY = "scanTime";
341 
342   String SLOW_MUTATE_KEY = "slowPutCount";
343   String SLOW_GET_KEY = "slowGetCount";
344   String SLOW_DELETE_KEY = "slowDeleteCount";
345   String SLOW_INCREMENT_KEY = "slowIncrementCount";
346   String SLOW_APPEND_KEY = "slowAppendCount";
347   String SLOW_MUTATE_DESC =
348       "The number of Multis that took over 1000ms to complete";
349   String SLOW_DELETE_DESC =
350       "The number of Deletes that took over 1000ms to complete";
351   String SLOW_GET_DESC = "The number of Gets that took over 1000ms to complete";
352   String SLOW_INCREMENT_DESC =
353       "The number of Increments that took over 1000ms to complete";
354   String SLOW_APPEND_DESC =
355       "The number of Appends that took over 1000ms to complete";
356 
357   String FLUSHED_CELLS = "flushedCellsCount";
358   String FLUSHED_CELLS_DESC = "The number of cells flushed to disk";
359   String FLUSHED_CELLS_SIZE = "flushedCellsSize";
360   String FLUSHED_CELLS_SIZE_DESC = "The total amount of data flushed to disk, in bytes";
361   String COMPACTED_CELLS = "compactedCellsCount";
362   String COMPACTED_CELLS_DESC = "The number of cells processed during minor compactions";
363   String COMPACTED_CELLS_SIZE = "compactedCellsSize";
364   String COMPACTED_CELLS_SIZE_DESC =
365       "The total amount of data processed during minor compactions, in bytes";
366   String MAJOR_COMPACTED_CELLS = "majorCompactedCellsCount";
367   String MAJOR_COMPACTED_CELLS_DESC =
368       "The number of cells processed during major compactions";
369   String MAJOR_COMPACTED_CELLS_SIZE = "majorCompactedCellsSize";
370   String MAJOR_COMPACTED_CELLS_SIZE_DESC =
371       "The total amount of data processed during major compactions, in bytes";
372 
373   String BLOCKED_REQUESTS_COUNT = "blockedRequestCount";
374   String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
375       + "larger than blockingMemStoreSize";
376 
377   String SPLIT_KEY = "splitTime";
378   String SPLIT_REQUEST_KEY = "splitRequestCount";
379   String SPLIT_REQUEST_DESC = "Number of splits requested";
380   String SPLIT_SUCCESS_KEY = "splitSuccessCount";
381   String SPLIT_SUCCESS_DESC = "Number of successfully executed splits";
382 
383   String FLUSH_TIME = "flushTime";
384   String FLUSH_TIME_DESC = "Histogram for the time in millis for memstore flush";
385   String FLUSH_MEMSTORE_SIZE = "flushMemstoreSize";
386   String FLUSH_MEMSTORE_SIZE_DESC = "Histogram for number of bytes in the memstore for a flush";
387   String FLUSH_OUTPUT_SIZE = "flushOutputSize";
388   String FLUSH_OUTPUT_SIZE_DESC = "Histogram for number of bytes in the resulting file for a flush";
389   String FLUSHED_OUTPUT_BYTES = "flushedOutputBytes";
390   String FLUSHED_OUTPUT_BYTES_DESC = "Total number of bytes written from flush";
391   String FLUSHED_MEMSTORE_BYTES = "flushedMemstoreBytes";
392   String FLUSHED_MEMSTORE_BYTES_DESC = "Total number of bytes of cells in memstore from flush";
393 
394   String COMPACTION_TIME = "compactionTime";
395   String COMPACTION_TIME_DESC
396     = "Histogram for the time in millis for compaction, both major and minor";
397   String COMPACTION_INPUT_FILE_COUNT = "compactionInputFileCount";
398   String COMPACTION_INPUT_FILE_COUNT_DESC
399     = "Histogram for the compaction input number of files, both major and minor";
400   String COMPACTION_INPUT_SIZE = "compactionInputSize";
401   String COMPACTION_INPUT_SIZE_DESC
402     = "Histogram for the compaction total input file sizes, both major and minor";
403   String COMPACTION_OUTPUT_FILE_COUNT = "compactionOutputFileCount";
404   String COMPACTION_OUTPUT_FILE_COUNT_DESC
405     = "Histogram for the compaction output number of files, both major and minor";
406   String COMPACTION_OUTPUT_SIZE = "compactionOutputSize";
407   String COMPACTION_OUTPUT_SIZE_DESC
408     = "Histogram for the compaction total output file sizes, both major and minor";
409   String COMPACTED_INPUT_BYTES = "compactedInputBytes";
410   String COMPACTED_INPUT_BYTES_DESC
411     = "Total number of bytes that is read for compaction, both major and minor";
412   String COMPACTED_OUTPUT_BYTES = "compactedOutputBytes";
413   String COMPACTED_OUTPUT_BYTES_DESC
414     = "Total number of bytes that is output from compaction, both major and minor";
415 
416   String MAJOR_COMPACTION_TIME = "majorCompactionTime";
417   String MAJOR_COMPACTION_TIME_DESC
418     = "Histogram for the time in millis for compaction, major only";
419   String MAJOR_COMPACTION_INPUT_FILE_COUNT = "majorCompactionInputFileCount";
420   String MAJOR_COMPACTION_INPUT_FILE_COUNT_DESC
421     = "Histogram for the compaction input number of files, major only";
422   String MAJOR_COMPACTION_INPUT_SIZE = "majorCompactionInputSize";
423   String MAJOR_COMPACTION_INPUT_SIZE_DESC
424     = "Histogram for the compaction total input file sizes, major only";
425   String MAJOR_COMPACTION_OUTPUT_FILE_COUNT = "majorCompactionOutputFileCount";
426   String MAJOR_COMPACTION_OUTPUT_FILE_COUNT_DESC
427     = "Histogram for the compaction output number of files, major only";
428   String MAJOR_COMPACTION_OUTPUT_SIZE = "majorCompactionOutputSize";
429   String MAJOR_COMPACTION_OUTPUT_SIZE_DESC
430     = "Histogram for the compaction total output file sizes, major only";
431   String MAJOR_COMPACTED_INPUT_BYTES = "majorCompactedInputBytes";
432   String MAJOR_COMPACTED_INPUT_BYTES_DESC
433     = "Total number of bytes that is read for compaction, major only";
434   String MAJOR_COMPACTED_OUTPUT_BYTES = "majorCompactedOutputBytes";
435   String MAJOR_COMPACTED_OUTPUT_BYTES_DESC
436     = "Total number of bytes that is output from compaction, major only";
437 
438   String RPC_GET_REQUEST_COUNT = "rpcGetRequestCount";
439   String RPC_GET_REQUEST_COUNT_DESC = "Number of rpc get requests this region server has answered.";
440   String RPC_SCAN_REQUEST_COUNT = "rpcScanRequestCount";
441   String RPC_SCAN_REQUEST_COUNT_DESC =
442       "Number of rpc scan requests this region server has answered.";
443   String RPC_MULTI_REQUEST_COUNT = "rpcMultiRequestCount";
444   String RPC_MULTI_REQUEST_COUNT_DESC =
445       "Number of rpc multi requests this region server has answered.";
446   String RPC_MUTATE_REQUEST_COUNT = "rpcMutateRequestCount";
447   String RPC_MUTATE_REQUEST_COUNT_DESC =
448       "Number of rpc mutation requests this region server has answered.";
449   String AVERAGE_REGION_SIZE = "averageRegionSize";
450   String AVERAGE_REGION_SIZE_DESC =
451       "Average region size over the region server including memstore and storefile sizes.";
452 }