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.rest;
20
21 import org.apache.hadoop.hbase.metrics.BaseSource;
22 import org.apache.hadoop.hbase.metrics.JvmPauseMonitorSource;
23
24 /**
25 * Interface of the Metrics Source that will export data to Hadoop's Metrics2 system.
26 */
27 public interface MetricsRESTSource extends BaseSource, JvmPauseMonitorSource {
28
29 String METRICS_NAME = "REST";
30
31 String CONTEXT = "rest";
32
33 String JMX_CONTEXT = "REST";
34
35 String METRICS_DESCRIPTION = "Metrics about the HBase REST server";
36
37 String REQUEST_KEY = "requests";
38
39 String SUCCESSFUL_GET_KEY = "successfulGet";
40
41 String SUCCESSFUL_PUT_KEY = "successfulPut";
42
43 String SUCCESSFUL_DELETE_KEY = "successfulDelete";
44
45 String FAILED_GET_KEY = "failedGet";
46
47 String FAILED_PUT_KEY = "failedPut";
48
49 String FAILED_DELETE_KEY = "failedDelete";
50
51 String SUCCESSFUL_SCAN_KEY = "successfulScanCount";
52
53 String FAILED_SCAN_KEY = "failedScanCount";
54
55 String SUCCESSFUL_APPEND_KEY = "successfulAppendCount";
56
57 String FAILED_APPEND_KEY = "failedAppendCount";
58
59 String SUCCESSFUL_INCREMENT_KEY = "successfulIncrementCount";
60
61 String FAILED_INCREMENT_KEY = "failedIncrementCount";
62
63 /**
64 * Increment the number of requests
65 *
66 * @param inc Ammount to increment by
67 */
68 void incrementRequests(int inc);
69
70 /**
71 * Increment the number of successful Get requests.
72 *
73 * @param inc Number of successful get requests.
74 */
75 void incrementSucessfulGetRequests(int inc);
76
77 /**
78 * Increment the number of successful Put requests.
79 *
80 * @param inc Number of successful put requests.
81 */
82 void incrementSucessfulPutRequests(int inc);
83
84 /**
85 * Increment the number of successful Delete requests.
86 *
87 * @param inc
88 */
89 void incrementSucessfulDeleteRequests(int inc);
90
91 /**
92 * Increment the number of failed Put Requests.
93 *
94 * @param inc Number of failed Put requests.
95 */
96 void incrementFailedPutRequests(int inc);
97
98 /**
99 * Increment the number of failed Get requests.
100 *
101 * @param inc The number of failed Get Requests.
102 */
103 void incrementFailedGetRequests(int inc);
104
105 /**
106 * Increment the number of failed Delete requests.
107 *
108 * @param inc The number of failed delete requests.
109 */
110 void incrementFailedDeleteRequests(int inc);
111
112 /**
113 * Increment the number of successful scan requests.
114 *
115 * @param inc Number of successful scan requests.
116 */
117 void incrementSucessfulScanRequests(final int inc);
118
119 /**
120 * Increment the number failed scan requests.
121 *
122 * @param inc Number of failed scan requests.
123 */
124 void incrementFailedScanRequests(final int inc);
125
126 /**
127 * Increment the number of successful append requests.
128 *
129 * @param inc Number of successful append requests.
130 */
131 void incrementSucessfulAppendRequests(final int inc);
132
133 /**
134 * Increment the number failed append requests.
135 *
136 * @param inc Number of failed append requests.
137 */
138 void incrementFailedAppendRequests(final int inc);
139
140 /**
141 * Increment the number of successful increment requests.
142 *
143 * @param inc Number of successful increment requests.
144 */
145 void incrementSucessfulIncrementRequests(final int inc);
146
147 /**
148 * Increment the number failed increment requests.
149 *
150 * @param inc Number of failed increment requests.
151 */
152 void incrementFailedIncrementRequests(final int inc);
153 }