Revert "Preparing hbase release 2.4.3RC1; tagging and updates to CHANGES.md and RELEA...
[hbase.git] / hbase-hbtop / README.md
blob41c2357761bbaa6a8cd3416cff705b23c2782036
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
10   http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied.  See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -->
20 # hbtop
22 ## Overview
24 `hbtop` is a real-time monitoring tool for HBase like Unix's top command.
25 It can display summary information as well as metrics per Region/Namespace/Table/RegionServer.
26 In this tool, you can see the metrics sorted by a selected field and filter the metrics to see only metrics you really want to see.
27 Also, with the drill-down feature, you can find hot regions easily in a top-down manner.
29 ## Usage
31 You can run hbtop with the following command:
33 ```
34 $ hbase hbtop
35 ```
37 In this case, the values of `hbase.client.zookeeper.quorum` and `zookeeper.znode.parent` in `hbase-site.xml` in the classpath or the default values of them are used to connect.
39 Or, you can specify your own zookeeper quorum and znode parent as follows:
41 ```
42 $ hbase hbtop -Dhbase.client.zookeeper.quorum=<zookeeper quorum> -Dzookeeper.znode.parent=<znode parent>
43 ```
45 ![Top screen](img/top_screen.gif "Top screen")
47 The top screen consists of a summary part and of a metrics part.
48 In the summary part, you can see `HBase Version`, `Cluster ID`, `The number of region servers`, `Region count`, `Average Cluster Load` and `Aggregated Request/s`.
49 In the metrics part, you can see metrics per Region/Namespace/Table/RegionServer depending on the selected mode.
50 The top screen is refreshed in a certain period – 3 seconds by default.
52 ### Scrolling metric records
54 You can scroll the metric records in the metrics part.
56 ![Scrolling metric records](img/scrolling_metric_records.gif "Scrolling metric records")
58 ### Command line arguments
60 | Argument | Description |
61 |---|---|
62 | -d,--delay &lt;arg&gt; | The refresh delay (in seconds); default is 3 seconds |
63 | -h,--help | Print usage; for help while the tool is running press `h` key |
64 | -m,--mode &lt;arg&gt; | The mode; `n` (Namespace)&#124;`t` (Table)&#124;r (Region)&#124;`s` (RegionServer), default is `r` (Region) |
66 ### Modes
68 There are the following 4 modes in hbtop:
70 | Mode | Description |
71 |---|---|
72 | Region | Showing metric records per region |
73 | Namespace | Showing metric records per namespace |
74 | Table | Showing metric records per table |
75 | RegionServer | Showing metric records per region server |
77 #### Region mode
79 In Region mode, the default sort field is `#REQ/S`.
81 The fields in this mode are as follows:
83 | Field | Description | Displayed by default |
84 |---|---|---|
85 | RNAME | Region Name | false |
86 | NAMESPACE | Namespace Name | true |
87 | TABLE | Table Name | true |
88 | SCODE | Start Code | false |
89 | REPID | Replica ID | false |
90 | REGION | Encoded Region Name | true |
91 | RS | Short Region Server Name | true |
92 | LRS | Long Region Server Name | false |
93 | #REQ/S | Request Count per second | true |
94 | #READ/S | Read Request Count per second | true |
95 | #FREAD/S | Filtered Read Request Count per second | true |
96 | #WRITE/S | Write Request Count per second | true |
97 | SF | StoreFile Size | true |
98 | USF | Uncompressed StoreFile Size | false |
99 | #SF | Number of StoreFiles | true |
100 | MEMSTORE | MemStore Size | true |
101 | LOCALITY | Block Locality | true |
102 | SKEY | Start Key | false |
103 | #COMPingCELL | Compacting Cell Count | false |
104 | #COMPedCELL | Compacted Cell Count | false |
105 | %COMP | Compaction Progress | false |
106 | LASTMCOMP | Last Major Compaction Time | false |
108 #### Namespace mode
110 In Namespace mode, the default sort field is `#REQ/S`.
112 The fields in this mode are as follows:
114 | Field | Description | Displayed by default |
115 |---|---|---|
116 | NAMESPACE | Namespace Name | true |
117 | #REGION | Region Count | true |
118 | #REQ/S | Request Count per second | true |
119 | #READ/S | Read Request Count per second | true |
120 | #FREAD/S | Filtered Read Request Count per second | true |
121 | #WRITE/S | Write Request Count per second | true |
122 | SF | StoreFile Size | true |
123 | USF | Uncompressed StoreFile Size | false |
124 | #SF | Number of StoreFiles | true |
125 | MEMSTORE | MemStore Size | true |
127 #### Table mode
129 In Table mode, the default sort field is `#REQ/S`.
131 The fields in this mode are as follows:
133 | Field | Description | Displayed by default |
134 |---|---|---|
135 | NAMESPACE | Namespace Name | true |
136 | TABLE | Table Name | true |
137 | #REGION | Region Count | true |
138 | #REQ/S | Request Count per second | true |
139 | #READ/S | Read Request Count per second | true |
140 | #FREAD/S | Filtered Read Request Count per second | true |
141 | #WRITE/S | Write Request Count per second | true |
142 | SF | StoreFile Size | true |
143 | USF | Uncompressed StoreFile Size | false |
144 | #SF | Number of StoreFiles | true |
145 | MEMSTORE | MemStore Size | true |
147 #### RegionServer mode
149 In RegionServer mode, the default sort field is `#REQ/S`.
151 The fields in this mode are as follows:
153 | Field | Description | Displayed by default |
154 |---|---|---|
155 | RS | Short Region Server Name | true |
156 | LRS | Long Region Server Name | false |
157 | #REGION | Region Count | true |
158 | #REQ/S | Request Count per second | true |
159 | #READ/S | Read Request Count per second | true |
160 | #FREAD/S | Filtered Read Request Count per second | true |
161 | #WRITE/S | Write Request Count per second | true |
162 | SF | StoreFile Size | true |
163 | USF | Uncompressed StoreFile Size | false |
164 | #SF | Number of StoreFiles | true |
165 | MEMSTORE | MemStore Size | true |
166 | UHEAP | Used Heap Size | true |
167 | MHEAP | Max Heap Size | true |
169 ### Changing mode
171 You can change mode by pressing `m` key in the top screen.
173 ![Changing mode](img/changing_mode.gif "Changing mode")
175 ### Changing the refresh delay
177 You can change the refresh by pressing `d` key in the top screen.
179 ![Changing the refresh delay](img/changing_refresh_delay.gif "Changing the refresh delay")
181 ### Changing the displayed fields
183 You can move to the field screen by pressing `f` key in the top screen. In the fields screen, you can change the displayed fields by choosing a field and pressing `d` key or `space` key.
185 ![Changing the displayed fields](img/changing_displayed_fields.gif "Changing the displayed fields")
187 ### Changing the sort field
189 You can move to the fields screen by pressing `f` key in the top screen. In the field screen, you can change the sort field by choosing a field and pressing `s`. Also, you can change the sort order (ascending or descending) by pressing `R` key.
191 ![Changing the sort field](img/changing_sort_field.gif "Changing the sort field")
194 ### Changing the order of the fields
196 You can move to the fields screen by pressing `f` key in the top screen. In the field screen, you can change the order of the fields.
198 ![Changing the order of the fields](img/changing_order_of_fields.gif "Changing the sort field")
200 ### Filters
202 You can filter the metric records with the filter feature. We can add filters by pressing `o` key for ignoring case or `O` key for case sensitive.
204 ![Adding filters](img/adding_filters.gif "Adding filters")
206 The syntax is as follows:
208 <Field><Operator><Value>
211 For example, we can add filters like the following:
213 NAMESPACE==default
214 REQ/S>1000
217 The operators we can specify are as follows:
219 | Operator | Description |
220 |---|---|
221 | = | Partial match |
222 | == | Exact match |
223 | > | Greater than |
224 | >= | Greater than or equal to |
225 | < | Less than |
226 | <= | Less than and equal to |
228 You can see the current filters by pressing `^o` key and clear them by pressing `=` key.
230 ![Showing and clearing filters](img/showing_and_clearing_filters.gif "Showing and clearing filters")
232 ### Drilling down
234 You can drill down the metric record by choosing a metric record that you want to drill down and pressing `i` key in the top screen. With this feature, you can find hot regions easily in a top-down manner.
236 ![Drilling down](img/driling_down.gif "Drilling down")
238 ### Help screen
240 You can see the help screen by pressing `h` key in the top screen.
242 ![Help screen](img/help_screen.gif "Help screen")
244 ## Others
246 ### How hbtop gets the metrics data
248 hbtop gets the metrics from ClusterMetrics which is returned as the result of a call to Admin#getClusterMetrics() on the current HMaster. To add metrics to hbtop, they will need to be exposed via ClusterMetrics.