View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.hadoop.hbase.regionserver;
18  
19  /**
20   * Latency metrics for a specific table in a RegionServer.
21   */
22  public interface MetricsTableLatencies {
23  
24    /**
25     * The name of the metrics
26     */
27    String METRICS_NAME = "TableLatencies";
28  
29    /**
30     * The name of the metrics context that metrics will be under.
31     */
32    String METRICS_CONTEXT = "regionserver";
33  
34    /**
35     * Description
36     */
37    String METRICS_DESCRIPTION = "Metrics about Tables on a single HBase RegionServer";
38  
39    /**
40     * The name of the metrics context that metrics will be under in jmx
41     */
42    String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
43  
44    String GET_TIME = "getTime";
45    String SCAN_TIME = "scanTime";
46    String SCAN_SIZE = "scanSize";
47    String PUT_TIME = "putTime";
48    String DELETE_TIME = "deleteTime";
49    String INCREMENT_TIME = "incrementTime";
50    String APPEND_TIME = "appendTime";
51  
52    /**
53     * Update the Put time histogram
54     *
55     * @param tableName The table the metric is for
56     * @param t time it took
57     */
58    void updatePut(String tableName, long t);
59  
60    /**
61     * Update the Delete time histogram
62     *
63     * @param tableName The table the metric is for
64     * @param t time it took
65     */
66    void updateDelete(String tableName, long t);
67  
68    /**
69     * Update the Get time histogram .
70     *
71     * @param tableName The table the metric is for
72     * @param t time it took
73     */
74    void updateGet(String tableName, long t);
75  
76    /**
77     * Update the Increment time histogram.
78     *
79     * @param tableName The table the metric is for
80     * @param t time it took
81     */
82    void updateIncrement(String tableName, long t);
83  
84    /**
85     * Update the Append time histogram.
86     *
87     * @param tableName The table the metric is for
88     * @param t time it took
89     */
90    void updateAppend(String tableName, long t);
91  
92    /**
93     * Update the scan size.
94     *
95     * @param tableName The table the metric is for
96     * @param scanSize size of the scan
97     */
98    void updateScanSize(String tableName, long scanSize);
99  
100   /**
101    * Update the scan time.
102    *
103    * @param tableName The table the metric is for
104    * @param t time it took
105    */
106   void updateScanTime(String tableName, long t);
107 }