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  import org.apache.hadoop.hbase.metrics.JvmPauseMonitorSource;
23  
24  /**
25   * Interface for classes that expose metrics about the regionserver.
26   */
27  public interface MetricsRegionServerSource extends BaseSource, JvmPauseMonitorSource {
28  
29    /**
30     * The name of the metrics
31     */
32    String METRICS_NAME = "Server";
33  
34    /**
35     * The name of the metrics context that metrics will be under.
36     */
37    String METRICS_CONTEXT = "regionserver";
38  
39    /**
40     * Description
41     */
42    String METRICS_DESCRIPTION = "Metrics about HBase RegionServer";
43  
44    /**
45     * The name of the metrics context that metrics will be under in jmx
46     */
47    String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
48  
49    /**
50     * Update the Put time histogram
51     *
52     * @param t time it took
53     */
54    void updatePut(long t);
55  
56    /**
57     * Update the Delete time histogram
58     *
59     * @param t time it took
60     */
61    void updateDelete(long t);
62  
63    /**
64     * Update the Get time histogram .
65     *
66     * @param t time it took
67     */
68    void updateGet(long t);
69  
70    /**
71     * Update the Increment time histogram.
72     *
73     * @param t time it took
74     */
75    void updateIncrement(long t);
76  
77    /**
78     * Update the Append time histogram.
79     *
80     * @param t time it took
81     */
82    void updateAppend(long t);
83  
84    /**
85     * Update the Replay time histogram.
86     *
87     * @param t time it took
88     */
89    void updateReplay(long t);
90  
91    /**
92     * Update the scan size.
93     *
94     * @param scanSize size of the scan
95     */
96    void updateScannerNext(long scanSize);
97  
98    /**
99     * Increment the number of slow Puts that have happened.
100    */
101   void incrSlowPut();
102 
103   /**
104    * Increment the number of slow Deletes that have happened.
105    */
106   void incrSlowDelete();
107 
108   /**
109    * Increment the number of slow Gets that have happened.
110    */
111   void incrSlowGet();
112 
113   /**
114    * Increment the number of slow Increments that have happened.
115    */
116   void incrSlowIncrement();
117 
118   /**
119    * Increment the number of slow Appends that have happened.
120    */
121   void incrSlowAppend();
122 
123   /**
124    * Update the split transaction time histogram
125    * @param t time it took, in milliseconds
126    */
127   void updateSplitTime(long t);
128 
129   /**
130    * Increment number of a requested splits
131    */
132   void incrSplitRequest();
133 
134   /**
135    * Increment number of successful splits
136    */
137   void incrSplitSuccess();
138 
139   /**
140    * Update the flush time histogram
141    * @param t time it took, in milliseconds
142    */
143   void updateFlushTime(long t);
144 
145   // Strings used for exporting to metrics system.
146   String REGION_COUNT = "regionCount";
147   String REGION_COUNT_DESC = "Number of regions";
148   String STORE_COUNT = "storeCount";
149   String STORE_COUNT_DESC = "Number of Stores";
150   String HLOGFILE_COUNT = "hlogFileCount";
151   String HLOGFILE_COUNT_DESC = "Number of HLog Files";
152   String HLOGFILE_SIZE = "hlogFileSize";
153   String HLOGFILE_SIZE_DESC = "Size of all HLog Files";
154   String STOREFILE_COUNT = "storeFileCount";
155   String STOREFILE_COUNT_DESC = "Number of Store Files";
156   String MEMSTORE_SIZE = "memStoreSize";
157   String MEMSTORE_SIZE_DESC = "Size of the memstore";
158   String STOREFILE_SIZE = "storeFileSize";
159   String MAX_STORE_FILE_AGE = "maxStoreFileAge";
160   String MIN_STORE_FILE_AGE = "minStoreFileAge";
161   String AVG_STORE_FILE_AGE = "avgStoreFileAge";
162   String NUM_REFERENCE_FILES = "numReferenceFiles";
163   String MAX_STORE_FILE_AGE_DESC = "Max age of store files hosted on this region server";
164   String MIN_STORE_FILE_AGE_DESC = "Min age of store files hosted on this region server";
165   String AVG_STORE_FILE_AGE_DESC = "Average age of store files hosted on this region server";
166   String NUM_REFERENCE_FILES_DESC = "Number of reference file on this region server";
167   String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
168   String TOTAL_REQUEST_COUNT = "totalRequestCount";
169   String TOTAL_REQUEST_COUNT_DESC =
170       "Total number of requests this RegionServer has answered.";
171   String READ_REQUEST_COUNT = "readRequestCount";
172   String READ_REQUEST_COUNT_DESC =
173       "Number of read requests this region server has answered.";
174   String WRITE_REQUEST_COUNT = "writeRequestCount";
175   String WRITE_REQUEST_COUNT_DESC =
176       "Number of mutation requests this region server has answered.";
177   String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
178   String CHECK_MUTATE_FAILED_COUNT_DESC =
179       "Number of Check and Mutate calls that failed the checks.";
180   String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
181   String CHECK_MUTATE_PASSED_COUNT_DESC =
182       "Number of Check and Mutate calls that passed the checks.";
183   String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
184   String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
185   String STATIC_INDEX_SIZE = "staticIndexSize";
186   String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
187   String STATIC_BLOOM_SIZE = "staticBloomSize";
188   String STATIC_BLOOM_SIZE_DESC =
189       "Uncompressed size of the static bloom filters.";
190   String NUMBER_OF_MUTATIONS_WITHOUT_WAL = "mutationsWithoutWALCount";
191   String NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC =
192       "Number of mutations that have been sent by clients with the write ahead logging turned off.";
193   String DATA_SIZE_WITHOUT_WAL = "mutationsWithoutWALSize";
194   String DATA_SIZE_WITHOUT_WAL_DESC =
195       "Size of data that has been sent by clients with the write ahead logging turned off.";
196   String PERCENT_FILES_LOCAL = "percentFilesLocal";
197   String PERCENT_FILES_LOCAL_DESC =
198       "The percent of HFiles that are stored on the local hdfs data node.";
199   String SPLIT_QUEUE_LENGTH = "splitQueueLength";
200   String SPLIT_QUEUE_LENGTH_DESC = "Length of the queue for splits.";
201   String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
202   String LARGE_COMPACTION_QUEUE_LENGTH = "largeCompactionQueueLength";
203   String SMALL_COMPACTION_QUEUE_LENGTH = "smallCompactionQueueLength";
204   String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
205   String FLUSH_QUEUE_LENGTH = "flushQueueLength";
206   String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
207   String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
208   String BLOCK_CACHE_FREE_DESC =
209       "Size of the block cache that is not occupied.";
210   String BLOCK_CACHE_COUNT = "blockCacheCount";
211   String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
212   String BLOCK_CACHE_SIZE = "blockCacheSize";
213   String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
214   String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
215   String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
216   String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
217   String BLOCK_COUNT_MISS_COUNT_DESC =
218       "Number of requests for a block that missed the block cache.";
219   String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
220   String BLOCK_CACHE_EVICTION_COUNT_DESC =
221       "Count of the number of blocks evicted from the block cache.";
222   String BLOCK_CACHE_HIT_PERCENT = "blockCountHitPercent";
223   String BLOCK_CACHE_HIT_PERCENT_DESC =
224       "Percent of block cache requests that are hits";
225   String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
226   String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
227       "The percent of the time that requests with the cache turned on hit the cache.";
228   String BLOCK_CACHE_FAILED_INSERTION_COUNT = "blockCacheFailedInsertionCount";
229   String BLOCK_CACHE_FAILED_INSERTION_COUNT_DESC = "Number of times that a block cache " +
230       "insertion failed. Usually due to size restrictions.";
231   String BLOCK_CACHE_DATA_MISS_COUNT = "blockCacheDataMissCount";
232   String BLOCK_CACHE_ENCODED_DATA_MISS_COUNT = "blockCacheEncodedDataMissCount";
233   String BLOCK_CACHE_LEAF_INDEX_MISS_COUNT = "blockCacheLeafIndexMissCount";
234   String BLOCK_CACHE_BLOOM_CHUNK_MISS_COUNT = "blockCacheBloomChunkMissCount";
235   String BLOCK_CACHE_META_MISS_COUNT = "blockCacheMetaMissCount";
236   String BLOCK_CACHE_ROOT_INDEX_MISS_COUNT = "blockCacheRootIndexMissCount";
237   String BLOCK_CACHE_INTERMEDIATE_INDEX_MISS_COUNT = "blockCacheIntermediateIndexMissCount";
238   String BLOCK_CACHE_FILE_INFO_MISS_COUNT = "blockCacheFileInfoMissCount";
239   String BLOCK_CACHE_GENERAL_BLOOM_META_MISS_COUNT = "blockCacheGeneralBloomMetaMissCount";
240   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_MISS_COUNT = "blockCacheDeleteFamilyBloomMissCount";
241   String BLOCK_CACHE_TRAILER_MISS_COUNT = "blockCacheTrailerMissCount";
242   String BLOCK_CACHE_DATA_HIT_COUNT = "blockCacheDataHitCount";
243   String BLOCK_CACHE_ENCODED_DATA_HIT_COUNT = "blockCacheEncodedDataHitCount";
244   String BLOCK_CACHE_LEAF_INDEX_HIT_COUNT = "blockCacheLeafIndexHitCount";
245   String BLOCK_CACHE_BLOOM_CHUNK_HIT_COUNT = "blockCacheBloomChunkHitCount";
246   String BLOCK_CACHE_META_HIT_COUNT = "blockCacheMetaHitCount";
247   String BLOCK_CACHE_ROOT_INDEX_HIT_COUNT = "blockCacheRootIndexHitCount";
248   String BLOCK_CACHE_INTERMEDIATE_INDEX_HIT_COUNT = "blockCacheIntermediateIndexHitCount";
249   String BLOCK_CACHE_FILE_INFO_HIT_COUNT = "blockCacheFileInfoHitCount";
250   String BLOCK_CACHE_GENERAL_BLOOM_META_HIT_COUNT = "blockCacheGeneralBloomMetaHitCount";
251   String BLOCK_CACHE_DELETE_FAMILY_BLOOM_HIT_COUNT = "blockCacheDeleteFamilyBloomHitCount";
252   String BLOCK_CACHE_TRAILER_HIT_COUNT = "blockCacheTrailerHitCount";
253   
254   String RS_START_TIME_NAME = "regionServerStartTime";
255   String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
256   String SERVER_NAME_NAME = "serverName";
257   String CLUSTER_ID_NAME = "clusterId";
258   String RS_START_TIME_DESC = "RegionServer Start Time";
259   String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
260   String SERVER_NAME_DESC = "Server Name";
261   String CLUSTER_ID_DESC = "Cluster Id";
262   String UPDATES_BLOCKED_TIME = "updatesBlockedTime";
263   String UPDATES_BLOCKED_DESC =
264       "Number of MS updates have been blocked so that the memstore can be flushed.";
265   String DELETE_KEY = "delete";
266   String GET_KEY = "get";
267   String INCREMENT_KEY = "increment";
268   String MUTATE_KEY = "mutate";
269   String APPEND_KEY = "append";
270   String REPLAY_KEY = "replay";
271   String SCAN_NEXT_KEY = "scanNext";
272   String SLOW_MUTATE_KEY = "slowPutCount";
273   String SLOW_GET_KEY = "slowGetCount";
274   String SLOW_DELETE_KEY = "slowDeleteCount";
275   String SLOW_INCREMENT_KEY = "slowIncrementCount";
276   String SLOW_APPEND_KEY = "slowAppendCount";
277   String SLOW_MUTATE_DESC =
278       "The number of Multis that took over 1000ms to complete";
279   String SLOW_DELETE_DESC =
280       "The number of Deletes that took over 1000ms to complete";
281   String SLOW_GET_DESC = "The number of Gets that took over 1000ms to complete";
282   String SLOW_INCREMENT_DESC =
283       "The number of Increments that took over 1000ms to complete";
284   String SLOW_APPEND_DESC =
285       "The number of Appends that took over 1000ms to complete";
286 
287   String FLUSHED_CELLS = "flushedCellsCount";
288   String FLUSHED_CELLS_DESC = "The number of cells flushed to disk";
289   String FLUSHED_CELLS_SIZE = "flushedCellsSize";
290   String FLUSHED_CELLS_SIZE_DESC = "The total amount of data flushed to disk, in bytes";
291   String COMPACTED_CELLS = "compactedCellsCount";
292   String COMPACTED_CELLS_DESC = "The number of cells processed during minor compactions";
293   String COMPACTED_CELLS_SIZE = "compactedCellsSize";
294   String COMPACTED_CELLS_SIZE_DESC =
295       "The total amount of data processed during minor compactions, in bytes";
296   String MAJOR_COMPACTED_CELLS = "majorCompactedCellsCount";
297   String MAJOR_COMPACTED_CELLS_DESC =
298       "The number of cells processed during major compactions";
299   String MAJOR_COMPACTED_CELLS_SIZE = "majorCompactedCellsSize";
300   String MAJOR_COMPACTED_CELLS_SIZE_DESC =
301       "The total amount of data processed during major compactions, in bytes";
302 
303   String BLOCKED_REQUESTS_COUNT = "blockedRequestCount";
304   String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
305       + "larger than blockingMemStoreSize";
306 
307   String SPLIT_KEY = "splitTime";
308   String SPLIT_REQUEST_KEY = "splitRequestCount";
309   String SPLIT_REQUEST_DESC = "Number of splits requested";
310   String SPLIT_SUCCESS_KEY = "splitSuccessCount";
311   String SPLIT_SUCCESS_DESC = "Number of successfully executed splits";
312   String FLUSH_KEY = "flushTime";
313 
314   String AVERAGE_REGION_SIZE = "averageRegionSize";
315   String AVERAGE_REGION_SIZE_DESC = 
316       "Average region size over the region server including memstore and storefile sizes.";
317 }