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 READ_REQUEST_RATE = "readRequestRate";
229   String READ_REQUEST_RATE_DESC =
230       "Rate of answering the read requests by this region server per second.";
231   String WRITE_REQUEST_RATE = "writeRequestRate";
232   String WRITE_REQUEST_RATE_DESC =
233       "Rate of answering the mutation requests by this region server per second.";
234   String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
235   String CHECK_MUTATE_FAILED_COUNT_DESC =
236       "Number of Check and Mutate calls that failed the checks.";
237   String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
238   String CHECK_MUTATE_PASSED_COUNT_DESC =
239       "Number of Check and Mutate calls that passed the checks.";
240   String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
241   String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
242   String STATIC_INDEX_SIZE = "staticIndexSize";
243   String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
244   String STATIC_BLOOM_SIZE = "staticBloomSize";
245   String STATIC_BLOOM_SIZE_DESC =
246       "Uncompressed size of the static bloom filters.";
247   String NUMBER_OF_MUTATIONS_WITHOUT_WAL = "mutationsWithoutWALCount";
248   String NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC =
249       "Number of mutations that have been sent by clients with the write ahead logging turned off.";
250   String DATA_SIZE_WITHOUT_WAL = "mutationsWithoutWALSize";
251   String DATA_SIZE_WITHOUT_WAL_DESC =
252       "Size of data that has been sent by clients with the write ahead logging turned off.";
253   String PERCENT_FILES_LOCAL = "percentFilesLocal";
254   String PERCENT_FILES_LOCAL_DESC =
255       "The percent of HFiles that are stored on the local hdfs data node.";
256   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS = "percentFilesLocalSecondaryRegions";
257   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS_DESC =
258     "The percent of HFiles used by secondary regions that are stored on the local hdfs data node.";
259   String SPLIT_QUEUE_LENGTH = "splitQueueLength";
260   String SPLIT_QUEUE_LENGTH_DESC = "Length of the queue for splits.";
261   String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
262   String LARGE_COMPACTION_QUEUE_LENGTH = "largeCompactionQueueLength";
263   String SMALL_COMPACTION_QUEUE_LENGTH = "smallCompactionQueueLength";
264   String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
265   String LARGE_COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions with input size "
266       + "larger than throttle threshold (2.5GB by default)";
267   String SMALL_COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions with input size "
268       + "smaller than throttle threshold (2.5GB by default)";
269   String FLUSH_QUEUE_LENGTH = "flushQueueLength";
270   String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
271   String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
272   String BLOCK_CACHE_FREE_DESC =
273       "Size of the block cache that is not occupied.";
274   String BLOCK_CACHE_COUNT = "blockCacheCount";
275   String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
276   String BLOCK_CACHE_SIZE = "blockCacheSize";
277   String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
278   String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
279   String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
280   String BLOCK_CACHE_PRIMARY_HIT_COUNT = "blockCacheHitCountPrimary";
281   String BLOCK_CACHE_PRIMARY_HIT_COUNT_DESC = "Count of hit on primary replica in the block cache.";
282   String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
283   String BLOCK_COUNT_MISS_COUNT_DESC =
284       "Number of requests for a block that missed the block cache.";
285   String BLOCK_CACHE_PRIMARY_MISS_COUNT = "blockCacheMissCountPrimary";
286   String BLOCK_COUNT_PRIMARY_MISS_COUNT_DESC =
287       "Number of requests for a block of primary replica that missed the block cache.";
288   String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
289   String BLOCK_CACHE_EVICTION_COUNT_DESC =
290       "Count of the number of blocks evicted from the block cache.";
291   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT = "blockCacheEvictionCountPrimary";
292   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT_DESC =
293       "Count of the number of blocks evicted from primary replica in the block cache.";
294   String BLOCK_CACHE_HIT_PERCENT = "blockCacheCountHitPercent";
295   String BLOCK_CACHE_HIT_PERCENT_DESC =
296       "Percent of block cache requests that are hits";
297   String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
298   String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
299       "The percent of the time that requests with the cache turned on hit the cache.";
300   String BLOCK_CACHE_FAILED_INSERTION_COUNT = "blockCacheFailedInsertionCount";
301   String BLOCK_CACHE_FAILED_INSERTION_COUNT_DESC = "Number of times that a block cache " +
302       "insertion failed. Usually due to size restrictions.";
303   String BLOCK_CACHE_DATA_MISS_COUNT = "blockCacheDataMissCount";
304   String BLOCK_CACHE_ENCODED_DATA_MISS_COUNT = "blockCacheEncodedDataMissCount";
305   String BLOCK_CACHE_LEAF_INDEX_MISS_COUNT = "blockCacheLeafIndexMissCount";
306   String BLOCK_CACHE_BLOOM_CHUNK_MISS_COUNT = "blockCacheBloomChunkMissCount";
307   String BLOCK_CACHE_META_MISS_COUNT = "blockCacheMetaMissCount";
308   String BLOCK_CACHE_ROOT_INDEX_MISS_COUNT = "blockCacheRootIndexMissCount";
309   String BLOCK_CACHE_INTERMEDIATE_INDEX_MISS_COUNT = "blockCacheIntermediateIndexMissCount";
310   String BLOCK_CACHE_FILE_INFO_MISS_COUNT = "blockCacheFileInfoMissCount";
311   String BLOCK_CACHE_GENERAL_BLOOM_META_MISS_COUNT = "blockCacheGeneralBloomMetaMissCount";
312   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_MISS_COUNT = "blockCacheDeleteFamilyBloomMissCount";
313   String BLOCK_CACHE_TRAILER_MISS_COUNT = "blockCacheTrailerMissCount";
314   String BLOCK_CACHE_DATA_HIT_COUNT = "blockCacheDataHitCount";
315   String BLOCK_CACHE_ENCODED_DATA_HIT_COUNT = "blockCacheEncodedDataHitCount";
316   String BLOCK_CACHE_LEAF_INDEX_HIT_COUNT = "blockCacheLeafIndexHitCount";
317   String BLOCK_CACHE_BLOOM_CHUNK_HIT_COUNT = "blockCacheBloomChunkHitCount";
318   String BLOCK_CACHE_META_HIT_COUNT = "blockCacheMetaHitCount";
319   String BLOCK_CACHE_ROOT_INDEX_HIT_COUNT = "blockCacheRootIndexHitCount";
320   String BLOCK_CACHE_INTERMEDIATE_INDEX_HIT_COUNT = "blockCacheIntermediateIndexHitCount";
321   String BLOCK_CACHE_FILE_INFO_HIT_COUNT = "blockCacheFileInfoHitCount";
322   String BLOCK_CACHE_GENERAL_BLOOM_META_HIT_COUNT = "blockCacheGeneralBloomMetaHitCount";
323   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_HIT_COUNT = "blockCacheDeleteFamilyBloomHitCount";
324   String BLOCK_CACHE_TRAILER_HIT_COUNT = "blockCacheTrailerHitCount";
325 
326   String RS_START_TIME_NAME = "regionServerStartTime";
327   String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
328   String SERVER_NAME_NAME = "serverName";
329   String CLUSTER_ID_NAME = "clusterId";
330   String RS_START_TIME_DESC = "RegionServer Start Time";
331   String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
332   String SERVER_NAME_DESC = "Server Name";
333   String CLUSTER_ID_DESC = "Cluster Id";
334   String UPDATES_BLOCKED_TIME = "updatesBlockedTime";
335   String UPDATES_BLOCKED_DESC =
336       "Number of MS updates have been blocked so that the memstore can be flushed.";
337   String DELETE_KEY = "delete";
338   String GET_SIZE_KEY = "getSize";
339   String GET_KEY = "get";
340   String INCREMENT_KEY = "increment";
341   String MUTATE_KEY = "mutate";
342   String APPEND_KEY = "append";
343   String REPLAY_KEY = "replay";
344   String SCAN_KEY = "scan";
345   String SCAN_SIZE_KEY = "scanSize";
346   String SCAN_TIME_KEY = "scanTime";
347 
348   String SLOW_MUTATE_KEY = "slowPutCount";
349   String SLOW_GET_KEY = "slowGetCount";
350   String SLOW_DELETE_KEY = "slowDeleteCount";
351   String SLOW_INCREMENT_KEY = "slowIncrementCount";
352   String SLOW_APPEND_KEY = "slowAppendCount";
353   String SLOW_MUTATE_DESC =
354       "The number of Multis that took over 1000ms to complete";
355   String SLOW_DELETE_DESC =
356       "The number of Deletes that took over 1000ms to complete";
357   String SLOW_GET_DESC = "The number of Gets that took over 1000ms to complete";
358   String SLOW_INCREMENT_DESC =
359       "The number of Increments that took over 1000ms to complete";
360   String SLOW_APPEND_DESC =
361       "The number of Appends that took over 1000ms to complete";
362 
363   String FLUSHED_CELLS = "flushedCellsCount";
364   String FLUSHED_CELLS_DESC = "The number of cells flushed to disk";
365   String FLUSHED_CELLS_SIZE = "flushedCellsSize";
366   String FLUSHED_CELLS_SIZE_DESC = "The total amount of data flushed to disk, in bytes";
367   String COMPACTED_CELLS = "compactedCellsCount";
368   String COMPACTED_CELLS_DESC = "The number of cells processed during minor compactions";
369   String COMPACTED_CELLS_SIZE = "compactedCellsSize";
370   String COMPACTED_CELLS_SIZE_DESC =
371       "The total amount of data processed during minor compactions, in bytes";
372   String MAJOR_COMPACTED_CELLS = "majorCompactedCellsCount";
373   String MAJOR_COMPACTED_CELLS_DESC =
374       "The number of cells processed during major compactions";
375   String MAJOR_COMPACTED_CELLS_SIZE = "majorCompactedCellsSize";
376   String MAJOR_COMPACTED_CELLS_SIZE_DESC =
377       "The total amount of data processed during major compactions, in bytes";
378 
379   String BLOCKED_REQUESTS_COUNT = "blockedRequestCount";
380   String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
381       + "larger than blockingMemStoreSize";
382 
383   String SPLIT_KEY = "splitTime";
384   String SPLIT_REQUEST_KEY = "splitRequestCount";
385   String SPLIT_REQUEST_DESC = "Number of splits requested";
386   String SPLIT_SUCCESS_KEY = "splitSuccessCount";
387   String SPLIT_SUCCESS_DESC = "Number of successfully executed splits";
388 
389   String FLUSH_TIME = "flushTime";
390   String FLUSH_TIME_DESC = "Histogram for the time in millis for memstore flush";
391   String FLUSH_MEMSTORE_SIZE = "flushMemstoreSize";
392   String FLUSH_MEMSTORE_SIZE_DESC = "Histogram for number of bytes in the memstore for a flush";
393   String FLUSH_OUTPUT_SIZE = "flushOutputSize";
394   String FLUSH_OUTPUT_SIZE_DESC = "Histogram for number of bytes in the resulting file for a flush";
395   String FLUSHED_OUTPUT_BYTES = "flushedOutputBytes";
396   String FLUSHED_OUTPUT_BYTES_DESC = "Total number of bytes written from flush";
397   String FLUSHED_MEMSTORE_BYTES = "flushedMemstoreBytes";
398   String FLUSHED_MEMSTORE_BYTES_DESC = "Total number of bytes of cells in memstore from flush";
399 
400   String COMPACTION_TIME = "compactionTime";
401   String COMPACTION_TIME_DESC
402     = "Histogram for the time in millis for compaction, both major and minor";
403   String COMPACTION_INPUT_FILE_COUNT = "compactionInputFileCount";
404   String COMPACTION_INPUT_FILE_COUNT_DESC
405     = "Histogram for the compaction input number of files, both major and minor";
406   String COMPACTION_INPUT_SIZE = "compactionInputSize";
407   String COMPACTION_INPUT_SIZE_DESC
408     = "Histogram for the compaction total input file sizes, both major and minor";
409   String COMPACTION_OUTPUT_FILE_COUNT = "compactionOutputFileCount";
410   String COMPACTION_OUTPUT_FILE_COUNT_DESC
411     = "Histogram for the compaction output number of files, both major and minor";
412   String COMPACTION_OUTPUT_SIZE = "compactionOutputSize";
413   String COMPACTION_OUTPUT_SIZE_DESC
414     = "Histogram for the compaction total output file sizes, both major and minor";
415   String COMPACTED_INPUT_BYTES = "compactedInputBytes";
416   String COMPACTED_INPUT_BYTES_DESC
417     = "Total number of bytes that is read for compaction, both major and minor";
418   String COMPACTED_OUTPUT_BYTES = "compactedOutputBytes";
419   String COMPACTED_OUTPUT_BYTES_DESC
420     = "Total number of bytes that is output from compaction, both major and minor";
421 
422   String MAJOR_COMPACTION_TIME = "majorCompactionTime";
423   String MAJOR_COMPACTION_TIME_DESC
424     = "Histogram for the time in millis for compaction, major only";
425   String MAJOR_COMPACTION_INPUT_FILE_COUNT = "majorCompactionInputFileCount";
426   String MAJOR_COMPACTION_INPUT_FILE_COUNT_DESC
427     = "Histogram for the compaction input number of files, major only";
428   String MAJOR_COMPACTION_INPUT_SIZE = "majorCompactionInputSize";
429   String MAJOR_COMPACTION_INPUT_SIZE_DESC
430     = "Histogram for the compaction total input file sizes, major only";
431   String MAJOR_COMPACTION_OUTPUT_FILE_COUNT = "majorCompactionOutputFileCount";
432   String MAJOR_COMPACTION_OUTPUT_FILE_COUNT_DESC
433     = "Histogram for the compaction output number of files, major only";
434   String MAJOR_COMPACTION_OUTPUT_SIZE = "majorCompactionOutputSize";
435   String MAJOR_COMPACTION_OUTPUT_SIZE_DESC
436     = "Histogram for the compaction total output file sizes, major only";
437   String MAJOR_COMPACTED_INPUT_BYTES = "majorCompactedInputBytes";
438   String MAJOR_COMPACTED_INPUT_BYTES_DESC
439     = "Total number of bytes that is read for compaction, major only";
440   String MAJOR_COMPACTED_OUTPUT_BYTES = "majorCompactedOutputBytes";
441   String MAJOR_COMPACTED_OUTPUT_BYTES_DESC
442     = "Total number of bytes that is output from compaction, major only";
443 
444   String RPC_GET_REQUEST_COUNT = "rpcGetRequestCount";
445   String RPC_GET_REQUEST_COUNT_DESC = "Number of rpc get requests this region server has answered.";
446   String RPC_SCAN_REQUEST_COUNT = "rpcScanRequestCount";
447   String RPC_SCAN_REQUEST_COUNT_DESC =
448       "Number of rpc scan requests this region server has answered.";
449   String RPC_MULTI_REQUEST_COUNT = "rpcMultiRequestCount";
450   String RPC_MULTI_REQUEST_COUNT_DESC =
451       "Number of rpc multi requests this region server has answered.";
452   String RPC_MUTATE_REQUEST_COUNT = "rpcMutateRequestCount";
453   String RPC_MUTATE_REQUEST_COUNT_DESC =
454       "Number of rpc mutation requests this region server has answered.";
455   String AVERAGE_REGION_SIZE = "averageRegionSize";
456   String AVERAGE_REGION_SIZE_DESC =
457       "Average region size over the region server including memstore and storefile sizes.";
458 }