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 PUT_BATCH_TIME = "putBatchTime";
49    String DELETE_TIME = "deleteTime";
50    String DELETE_BATCH_TIME = "deleteBatchTime";
51    String INCREMENT_TIME = "incrementTime";
52    String APPEND_TIME = "appendTime";
53  
54    /**
55     * Update the Put time histogram
56     *
57     * @param tableName The table the metric is for
58     * @param t time it took
59     */
60    void updatePut(String tableName, long t);
61  
62    /**
63     * Update the batch Put time histogram
64     *
65     * @param tableName The table the metric is for
66     * @param t time it took
67     */
68    void updatePutBatch(String tableName, long t);
69  
70    /**
71     * Update the Delete time histogram
72     *
73     * @param tableName The table the metric is for
74     * @param t time it took
75     */
76    void updateDelete(String tableName, long t);
77  
78    /**
79     * Update the batch Delete time histogram
80     *
81     * @param tableName The table the metric is for
82     * @param t time it took
83     */
84    void updateDeleteBatch(String tableName, long t);
85  
86    /**
87     * Update the Get time histogram .
88     *
89     * @param tableName The table the metric is for
90     * @param t time it took
91     */
92    void updateGet(String tableName, long t);
93  
94    /**
95     * Update the Increment time histogram.
96     *
97     * @param tableName The table the metric is for
98     * @param t time it took
99     */
100   void updateIncrement(String tableName, long t);
101 
102   /**
103    * Update the Append time histogram.
104    *
105    * @param tableName The table the metric is for
106    * @param t time it took
107    */
108   void updateAppend(String tableName, long t);
109 
110   /**
111    * Update the scan size.
112    *
113    * @param tableName The table the metric is for
114    * @param scanSize size of the scan
115    */
116   void updateScanSize(String tableName, long scanSize);
117 
118   /**
119    * Update the scan time.
120    *
121    * @param tableName The table the metric is for
122    * @param t time it took
123    */
124   void updateScanTime(String tableName, long t);
125 }