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     * Increment the number of slow Puts that have happened.
92     */
93    void incrSlowPut();
94  
95    /**
96     * Increment the number of slow Deletes that have happened.
97     */
98    void incrSlowDelete();
99  
100   /**
101    * Increment the number of slow Gets that have happened.
102    */
103   void incrSlowGet();
104 
105   /**
106    * Increment the number of slow Increments that have happened.
107    */
108   void incrSlowIncrement();
109 
110   /**
111    * Increment the number of slow Appends that have happened.
112    */
113   void incrSlowAppend();
114 
115   /**
116    * Update the split transaction time histogram
117    * @param t time it took, in milliseconds
118    */
119   void updateSplitTime(long t);
120 
121   /**
122    * Update the flush time histogram
123    * @param t time it took, in milliseconds
124    */
125   void updateFlushTime(long t);
126 
127   // Strings used for exporting to metrics system.
128   String REGION_COUNT = "regionCount";
129   String REGION_COUNT_DESC = "Number of regions";
130   String STORE_COUNT = "storeCount";
131   String STORE_COUNT_DESC = "Number of Stores";
132   String WALFILE_COUNT = "hlogFileCount";
133   String WALFILE_COUNT_DESC = "Number of WAL Files";
134   String WALFILE_SIZE = "hlogFileSize";
135   String WALFILE_SIZE_DESC = "Size of all WAL Files";
136   String STOREFILE_COUNT = "storeFileCount";
137   String STOREFILE_COUNT_DESC = "Number of Store Files";
138   String MEMSTORE_SIZE = "memStoreSize";
139   String MEMSTORE_SIZE_DESC = "Size of the memstore";
140   String STOREFILE_SIZE = "storeFileSize";
141   String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
142   String TOTAL_REQUEST_COUNT = "totalRequestCount";
143   String TOTAL_REQUEST_COUNT_DESC =
144       "Total number of requests this RegionServer has answered.";
145   String READ_REQUEST_COUNT = "readRequestCount";
146   String READ_REQUEST_COUNT_DESC =
147       "Number of read requests this region server has answered.";
148   String WRITE_REQUEST_COUNT = "writeRequestCount";
149   String WRITE_REQUEST_COUNT_DESC =
150       "Number of mutation requests this region server has answered.";
151   String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
152   String CHECK_MUTATE_FAILED_COUNT_DESC =
153       "Number of Check and Mutate calls that failed the checks.";
154   String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
155   String CHECK_MUTATE_PASSED_COUNT_DESC =
156       "Number of Check and Mutate calls that passed the checks.";
157   String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
158   String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
159   String STATIC_INDEX_SIZE = "staticIndexSize";
160   String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
161   String STATIC_BLOOM_SIZE = "staticBloomSize";
162   String STATIC_BLOOM_SIZE_DESC =
163       "Uncompressed size of the static bloom filters.";
164   String NUMBER_OF_MUTATIONS_WITHOUT_WAL = "mutationsWithoutWALCount";
165   String NUMBER_OF_MUTATIONS_WITHOUT_WAL_DESC =
166       "Number of mutations that have been sent by clients with the write ahead logging turned off.";
167   String DATA_SIZE_WITHOUT_WAL = "mutationsWithoutWALSize";
168   String DATA_SIZE_WITHOUT_WAL_DESC =
169       "Size of data that has been sent by clients with the write ahead logging turned off.";
170   String PERCENT_FILES_LOCAL = "percentFilesLocal";
171   String PERCENT_FILES_LOCAL_DESC =
172       "The percent of HFiles that are stored on the local hdfs data node.";
173   String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
174   String LARGE_COMPACTION_QUEUE_LENGTH = "largeCompactionQueueLength";
175   String SMALL_COMPACTION_QUEUE_LENGTH = "smallCompactionQueueLength";
176   String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
177   String FLUSH_QUEUE_LENGTH = "flushQueueLength";
178   String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
179   String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
180   String BLOCK_CACHE_FREE_DESC =
181       "Size of the block cache that is not occupied.";
182   String BLOCK_CACHE_COUNT = "blockCacheCount";
183   String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
184   String BLOCK_CACHE_SIZE = "blockCacheSize";
185   String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
186   String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
187   String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
188   String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
189   String BLOCK_COUNT_MISS_COUNT_DESC =
190       "Number of requests for a block that missed the block cache.";
191   String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
192   String BLOCK_CACHE_EVICTION_COUNT_DESC =
193       "Count of the number of blocks evicted from the block cache.";
194   String BLOCK_CACHE_HIT_PERCENT = "blockCacheCountHitPercent";
195   String BLOCK_CACHE_HIT_PERCENT_DESC =
196       "Percent of block cache requests that are hits";
197   String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
198   String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
199       "The percent of the time that requests with the cache turned on hit the cache.";
200   String RS_START_TIME_NAME = "regionServerStartTime";
201   String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
202   String SERVER_NAME_NAME = "serverName";
203   String CLUSTER_ID_NAME = "clusterId";
204   String RS_START_TIME_DESC = "RegionServer Start Time";
205   String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
206   String SERVER_NAME_DESC = "Server Name";
207   String CLUSTER_ID_DESC = "Cluster Id";
208   String UPDATES_BLOCKED_TIME = "updatesBlockedTime";
209   String UPDATES_BLOCKED_DESC =
210       "Number of MS updates have been blocked so that the memstore can be flushed.";
211   String DELETE_KEY = "delete";
212   String GET_KEY = "get";
213   String INCREMENT_KEY = "increment";
214   String MUTATE_KEY = "mutate";
215   String APPEND_KEY = "append";
216   String REPLAY_KEY = "replay";
217   String SCAN_NEXT_KEY = "scanNext";
218   String SLOW_MUTATE_KEY = "slowPutCount";
219   String SLOW_GET_KEY = "slowGetCount";
220   String SLOW_DELETE_KEY = "slowDeleteCount";
221   String SLOW_INCREMENT_KEY = "slowIncrementCount";
222   String SLOW_APPEND_KEY = "slowAppendCount";
223   String SLOW_MUTATE_DESC =
224       "The number of Multis that took over 1000ms to complete";
225   String SLOW_DELETE_DESC =
226       "The number of Deletes that took over 1000ms to complete";
227   String SLOW_GET_DESC = "The number of Gets that took over 1000ms to complete";
228   String SLOW_INCREMENT_DESC =
229       "The number of Increments that took over 1000ms to complete";
230   String SLOW_APPEND_DESC =
231       "The number of Appends that took over 1000ms to complete";
232 
233   String FLUSHED_CELLS = "flushedCellsCount";
234   String FLUSHED_CELLS_DESC = "The number of cells flushed to disk";
235   String FLUSHED_CELLS_SIZE = "flushedCellsSize";
236   String FLUSHED_CELLS_SIZE_DESC = "The total amount of data flushed to disk, in bytes";
237   String COMPACTED_CELLS = "compactedCellsCount";
238   String COMPACTED_CELLS_DESC = "The number of cells processed during minor compactions";
239   String COMPACTED_CELLS_SIZE = "compactedCellsSize";
240   String COMPACTED_CELLS_SIZE_DESC =
241       "The total amount of data processed during minor compactions, in bytes";
242   String MAJOR_COMPACTED_CELLS = "majorCompactedCellsCount";
243   String MAJOR_COMPACTED_CELLS_DESC =
244       "The number of cells processed during major compactions";
245   String MAJOR_COMPACTED_CELLS_SIZE = "majorCompactedCellsSize";
246   String MAJOR_COMPACTED_CELLS_SIZE_DESC =
247       "The total amount of data processed during major compactions, in bytes";
248 
249   String HEDGED_READS = "hedgedReads";
250   String HEDGED_READS_DESC = "The number of times we started a hedged read";
251   String HEDGED_READ_WINS = "hedgedReadWins";
252   String HEDGED_READ_WINS_DESC =
253       "The number of times we started a hedged read and a hedged read won";
254 
255   String BLOCKED_REQUESTS_COUNT = "blockedRequestCount";
256   String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
257       + "larger than blockingMemStoreSize";
258 
259   String SPLIT_KEY = "splitTime";
260   String FLUSH_KEY = "flushTime";
261 }