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 /** 56 * Increment the number of requests 57 * 58 * @param inc Ammount to increment by 59 */ 60 void incrementRequests(int inc); 61 62 /** 63 * Increment the number of successful Get requests. 64 * 65 * @param inc Number of successful get requests. 66 */ 67 void incrementSucessfulGetRequests(int inc); 68 69 /** 70 * Increment the number of successful Put requests. 71 * 72 * @param inc Number of successful put requests. 73 */ 74 void incrementSucessfulPutRequests(int inc); 75 76 /** 77 * Increment the number of successful Delete requests. 78 * 79 * @param inc 80 */ 81 void incrementSucessfulDeleteRequests(int inc); 82 83 /** 84 * Increment the number of failed Put Requests. 85 * 86 * @param inc Number of failed Put requests. 87 */ 88 void incrementFailedPutRequests(int inc); 89 90 /** 91 * Increment the number of failed Get requests. 92 * 93 * @param inc The number of failed Get Requests. 94 */ 95 void incrementFailedGetRequests(int inc); 96 97 /** 98 * Increment the number of failed Delete requests. 99 * 100 * @param inc The number of failed delete requests. 101 */ 102 void incrementFailedDeleteRequests(int inc); 103 104 /** 105 * Increment the number of successful scan requests. 106 * 107 * @param inc Number of successful scan requests. 108 */ 109 void incrementSucessfulScanRequests(final int inc); 110 111 /** 112 * Increment the number failed scan requests. 113 * 114 * @param inc the inc 115 */ 116 void incrementFailedScanRequests(final int inc); 117 }