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 updateScannerNext(long scanSize);
96  
97    /**
98     * Increment the number of slow Puts that have happened.
99     */
100   void incrSlowPut();
101 
102   /**
103    * Increment the number of slow Deletes that have happened.
104    */
105   void incrSlowDelete();
106 
107   /**
108    * Increment the number of slow Gets that have happened.
109    */
110   void incrSlowGet();
111 
112   /**
113    * Increment the number of slow Increments that have happened.
114    */
115   void incrSlowIncrement();
116 
117   /**
118    * Increment the number of slow Appends that have happened.
119    */
120   void incrSlowAppend();
121 
122   /**
123    * Update the split transaction time histogram
124    * @param t time it took, in milliseconds
125    */
126   void updateSplitTime(long t);
127 
128   /**
129    * Increment number of a requested splits
130    */
131   void incrSplitRequest();
132 
133   /**
134    * Increment number of successful splits
135    */
136   void incrSplitSuccess();
137 
138   /**
139    * Update the flush time histogram
140    * @param t time it took, in milliseconds
141    */
142   void updateFlushTime(long t);
143 
144   // Strings used for exporting to metrics system.
145   String REGION_COUNT = "regionCount";
146   String REGION_COUNT_DESC = "Number of regions";
147   String STORE_COUNT = "storeCount";
148   String STORE_COUNT_DESC = "Number of Stores";
149   String WALFILE_COUNT = "hlogFileCount";
150   String WALFILE_COUNT_DESC = "Number of WAL Files";
151   String WALFILE_SIZE = "hlogFileSize";
152   String WALFILE_SIZE_DESC = "Size of all WAL Files";
153   String STOREFILE_COUNT = "storeFileCount";
154   String STOREFILE_COUNT_DESC = "Number of Store Files";
155   String MEMSTORE_SIZE = "memStoreSize";
156   String MEMSTORE_SIZE_DESC = "Size of the memstore";
157   String STOREFILE_SIZE = "storeFileSize";
158   String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
159   String TOTAL_REQUEST_COUNT = "totalRequestCount";
160   String TOTAL_REQUEST_COUNT_DESC =
161       "Total number of requests this RegionServer has answered.";
162   String READ_REQUEST_COUNT = "readRequestCount";
163   String READ_REQUEST_COUNT_DESC =
164       "Number of read requests this region server has answered.";
165   String FILTERED_READ_REQUEST_COUNT = "filteredReadRequestCount";
166   String FILTERED_READ_REQUEST_COUNT_DESC =
167     "Number of filtered read requests this region server has answered.";
168   String WRITE_REQUEST_COUNT = "writeRequestCount";
169   String WRITE_REQUEST_COUNT_DESC =
170       "Number of mutation requests this region server has answered.";
171   String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
172   String CHECK_MUTATE_FAILED_COUNT_DESC =
173       "Number of Check and Mutate calls that failed the checks.";
174   String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
175   String CHECK_MUTATE_PASSED_COUNT_DESC =
176       "Number of Check and Mutate calls that passed the checks.";
177   String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
178   String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
179   String STATIC_INDEX_SIZE = "staticIndexSize";
180   String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
181   String STATIC_BLOOM_SIZE = "staticBloomSize";
182   String STATIC_BLOOM_SIZE_DESC =
183       "Uncompressed size of the static bloom filters.";
184   String NUMBER_OF_MUTATIONS_WITHOUT_WAL = "mutationsWithoutWALCount";
185   String NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC =
186       "Number of mutations that have been sent by clients with the write ahead logging turned off.";
187   String DATA_SIZE_WITHOUT_WAL = "mutationsWithoutWALSize";
188   String DATA_SIZE_WITHOUT_WAL_DESC =
189       "Size of data that has been sent by clients with the write ahead logging turned off.";
190   String PERCENT_FILES_LOCAL = "percentFilesLocal";
191   String PERCENT_FILES_LOCAL_DESC =
192       "The percent of HFiles that are stored on the local hdfs data node.";
193   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS = "percentFilesLocalSecondaryRegions";
194   String PERCENT_FILES_LOCAL_SECONDARY_REGIONS_DESC =
195     "The percent of HFiles used by secondary regions that are stored on the local hdfs data node.";
196   String SPLIT_QUEUE_LENGTH = "splitQueueLength";
197   String SPLIT_QUEUE_LENGTH_DESC = "Length of the queue for splits.";
198   String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
199   String LARGE_COMPACTION_QUEUE_LENGTH = "largeCompactionQueueLength";
200   String SMALL_COMPACTION_QUEUE_LENGTH = "smallCompactionQueueLength";
201   String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
202   String FLUSH_QUEUE_LENGTH = "flushQueueLength";
203   String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
204   String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
205   String BLOCK_CACHE_FREE_DESC =
206       "Size of the block cache that is not occupied.";
207   String BLOCK_CACHE_COUNT = "blockCacheCount";
208   String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
209   String BLOCK_CACHE_SIZE = "blockCacheSize";
210   String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
211   String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
212   String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
213   String BLOCK_CACHE_PRIMARY_HIT_COUNT = "blockCacheHitCountPrimary";
214   String BLOCK_CACHE_PRIMARY_HIT_COUNT_DESC = "Count of hit on primary replica in the block cache.";
215   String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
216   String BLOCK_COUNT_MISS_COUNT_DESC =
217       "Number of requests for a block that missed the block cache.";
218   String BLOCK_CACHE_PRIMARY_MISS_COUNT = "blockCacheMissCountPrimary";
219   String BLOCK_COUNT_PRIMARY_MISS_COUNT_DESC =
220       "Number of requests for a block of primary replica that missed the block cache.";
221   String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
222   String BLOCK_CACHE_EVICTION_COUNT_DESC =
223       "Count of the number of blocks evicted from the block cache.";
224   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT = "blockCacheEvictionCountPrimary";
225   String BLOCK_CACHE_PRIMARY_EVICTION_COUNT_DESC =
226       "Count of the number of blocks evicted from primary replica in the block cache.";
227   String BLOCK_CACHE_HIT_PERCENT = "blockCacheCountHitPercent";
228   String BLOCK_CACHE_HIT_PERCENT_DESC =
229       "Percent of block cache requests that are hits";
230   String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
231   String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
232       "The percent of the time that requests with the cache turned on hit the cache.";
233   String BLOCK_CACHE_FAILED_INSERTION_COUNT = "blockCacheFailedInsertionCount";
234   String BLOCK_CACHE_FAILED_INSERTION_COUNT_DESC = "Number of times that a block cache " +
235       "insertion failed. Usually due to size restrictions.";
236   String RS_START_TIME_NAME = "regionServerStartTime";
237   String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
238   String SERVER_NAME_NAME = "serverName";
239   String CLUSTER_ID_NAME = "clusterId";
240   String RS_START_TIME_DESC = "RegionServer Start Time";
241   String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
242   String SERVER_NAME_DESC = "Server Name";
243   String CLUSTER_ID_DESC = "Cluster Id";
244   String UPDATES_BLOCKED_TIME = "updatesBlockedTime";
245   String UPDATES_BLOCKED_DESC =
246       "Number of MS updates have been blocked so that the memstore can be flushed.";
247   String DELETE_KEY = "delete";
248   String GET_KEY = "get";
249   String INCREMENT_KEY = "increment";
250   String MUTATE_KEY = "mutate";
251   String APPEND_KEY = "append";
252   String REPLAY_KEY = "replay";
253   String SCAN_NEXT_KEY = "scanNext";
254   String SLOW_MUTATE_KEY = "slowPutCount";
255   String SLOW_GET_KEY = "slowGetCount";
256   String SLOW_DELETE_KEY = "slowDeleteCount";
257   String SLOW_INCREMENT_KEY = "slowIncrementCount";
258   String SLOW_APPEND_KEY = "slowAppendCount";
259   String SLOW_MUTATE_DESC =
260       "The number of Multis that took over 1000ms to complete";
261   String SLOW_DELETE_DESC =
262       "The number of Deletes that took over 1000ms to complete";
263   String SLOW_GET_DESC = "The number of Gets that took over 1000ms to complete";
264   String SLOW_INCREMENT_DESC =
265       "The number of Increments that took over 1000ms to complete";
266   String SLOW_APPEND_DESC =
267       "The number of Appends that took over 1000ms to complete";
268 
269   String FLUSHED_CELLS = "flushedCellsCount";
270   String FLUSHED_CELLS_DESC = "The number of cells flushed to disk";
271   String FLUSHED_CELLS_SIZE = "flushedCellsSize";
272   String FLUSHED_CELLS_SIZE_DESC = "The total amount of data flushed to disk, in bytes";
273   String COMPACTED_CELLS = "compactedCellsCount";
274   String COMPACTED_CELLS_DESC = "The number of cells processed during minor compactions";
275   String COMPACTED_CELLS_SIZE = "compactedCellsSize";
276   String COMPACTED_CELLS_SIZE_DESC =
277       "The total amount of data processed during minor compactions, in bytes";
278   String MAJOR_COMPACTED_CELLS = "majorCompactedCellsCount";
279   String MAJOR_COMPACTED_CELLS_DESC =
280       "The number of cells processed during major compactions";
281   String MAJOR_COMPACTED_CELLS_SIZE = "majorCompactedCellsSize";
282   String MAJOR_COMPACTED_CELLS_SIZE_DESC =
283       "The total amount of data processed during major compactions, in bytes";
284   String CELLS_COUNT_COMPACTED_TO_MOB = "cellsCountCompactedToMob";
285   String CELLS_COUNT_COMPACTED_TO_MOB_DESC =
286       "The number of cells moved to mob during compaction";
287   String CELLS_COUNT_COMPACTED_FROM_MOB = "cellsCountCompactedFromMob";
288   String CELLS_COUNT_COMPACTED_FROM_MOB_DESC =
289       "The number of cells moved from mob during compaction";
290   String CELLS_SIZE_COMPACTED_TO_MOB = "cellsSizeCompactedToMob";
291   String CELLS_SIZE_COMPACTED_TO_MOB_DESC =
292       "The total amount of cells move to mob during compaction, in bytes";
293   String CELLS_SIZE_COMPACTED_FROM_MOB = "cellsSizeCompactedFromMob";
294   String CELLS_SIZE_COMPACTED_FROM_MOB_DESC =
295       "The total amount of cells move from mob during compaction, in bytes";
296   String MOB_FLUSH_COUNT = "mobFlushCount";
297   String MOB_FLUSH_COUNT_DESC = "The number of the flushes in mob-enabled stores";
298   String MOB_FLUSHED_CELLS_COUNT = "mobFlushedCellsCount";
299   String MOB_FLUSHED_CELLS_COUNT_DESC = "The number of mob cells flushed to disk";
300   String MOB_FLUSHED_CELLS_SIZE = "mobFlushedCellsSize";
301   String MOB_FLUSHED_CELLS_SIZE_DESC = "The total amount of mob cells flushed to disk, in bytes";
302   String MOB_SCAN_CELLS_COUNT = "mobScanCellsCount";
303   String MOB_SCAN_CELLS_COUNT_DESC = "The number of scanned mob cells";
304   String MOB_SCAN_CELLS_SIZE = "mobScanCellsSize";
305   String MOB_SCAN_CELLS_SIZE_DESC = "The total amount of scanned mob cells, in bytes";
306   String MOB_FILE_CACHE_ACCESS_COUNT = "mobFileCacheAccessCount";
307   String MOB_FILE_CACHE_ACCESS_COUNT_DESC = "The count of accesses to the mob file cache";
308   String MOB_FILE_CACHE_MISS_COUNT = "mobFileCacheMissCount";
309   String MOB_FILE_CACHE_MISS_COUNT_DESC = "The count of misses to the mob file cache";
310   String MOB_FILE_CACHE_HIT_PERCENT = "mobFileCacheHitPercent";
311   String MOB_FILE_CACHE_HIT_PERCENT_DESC = "The hit percent to the mob file cache";
312   String MOB_FILE_CACHE_EVICTED_COUNT = "mobFileCacheEvictedCount";
313   String MOB_FILE_CACHE_EVICTED_COUNT_DESC = "The number of items evicted from the mob file cache";
314   String MOB_FILE_CACHE_COUNT = "mobFileCacheCount";
315   String MOB_FILE_CACHE_COUNT_DESC = "The count of cached mob files";
316 
317   String HEDGED_READS = "hedgedReads";
318   String HEDGED_READS_DESC = "The number of times we started a hedged read";
319   String HEDGED_READ_WINS = "hedgedReadWins";
320   String HEDGED_READ_WINS_DESC =
321       "The number of times we started a hedged read and a hedged read won";
322 
323   String BLOCKED_REQUESTS_COUNT = "blockedRequestCount";
324   String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
325       + "larger than blockingMemStoreSize";
326 
327   String SPLIT_KEY = "splitTime";
328   String SPLIT_REQUEST_KEY = "splitRequestCount";
329   String SPLIT_REQUEST_DESC = "Number of splits requested";
330   String SPLIT_SUCCESS_KEY = "splitSuccessCount";
331   String SPLIT_SUCCESS_DESC = "Number of successfully executed splits";
332   String FLUSH_KEY = "flushTime";
333 }