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 String CHECK_AND_DELETE_TIME = "checkAndDeleteTime";
54 String CHECK_AND_PUT_TIME = "checkAndPutTime";
55
56 /**
57 * Update the Put time histogram
58 *
59 * @param tableName The table the metric is for
60 * @param t time it took
61 */
62 void updatePut(String tableName, long t);
63
64 /**
65 * Update the batch Put time histogram
66 *
67 * @param tableName The table the metric is for
68 * @param t time it took
69 */
70 void updatePutBatch(String tableName, long t);
71
72 /**
73 * Update the Delete time histogram
74 *
75 * @param tableName The table the metric is for
76 * @param t time it took
77 */
78 void updateDelete(String tableName, long t);
79
80 /**
81 * Update the batch Delete time histogram
82 *
83 * @param tableName The table the metric is for
84 * @param t time it took
85 */
86 void updateDeleteBatch(String tableName, long t);
87
88 /**
89 * Update the Get time histogram .
90 *
91 * @param tableName The table the metric is for
92 * @param t time it took
93 */
94 void updateGet(String tableName, long t);
95
96 /**
97 * Update the Increment time histogram.
98 *
99 * @param tableName The table the metric is for
100 * @param t time it took
101 */
102 void updateIncrement(String tableName, long t);
103
104 /**
105 * Update the Append time histogram.
106 *
107 * @param tableName The table the metric is for
108 * @param t time it took
109 */
110 void updateAppend(String tableName, long t);
111
112 /**
113 * Update the scan size.
114 *
115 * @param tableName The table the metric is for
116 * @param scanSize size of the scan
117 */
118 void updateScanSize(String tableName, long scanSize);
119
120 /**
121 * Update the scan time.
122 *
123 * @param tableName The table the metric is for
124 * @param t time it took
125 */
126 void updateScanTime(String tableName, long t);
127
128 /**
129 * Update the CheckAndDelete time histogram.
130 * @param nameAsString The table the metric is for
131 * @param time time it took
132 */
133 void updateCheckAndDelete(String nameAsString, long time);
134
135 /**
136 * Update the CheckAndPut time histogram.
137 * @param nameAsString The table the metric is for
138 * @param time time it took
139 */
140 void updateCheckAndPut(String nameAsString, long time);
141
142 }