001/** 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019package org.apache.hadoop.hbase.rest; 020 021import org.apache.hadoop.hbase.metrics.BaseSource; 022import org.apache.hadoop.hbase.metrics.JvmPauseMonitorSource; 023import org.apache.yetus.audience.InterfaceAudience; 024 025/** 026 * Interface of the Metrics Source that will export data to Hadoop's Metrics2 system. 027 */ 028@InterfaceAudience.Private 029public interface MetricsRESTSource extends BaseSource, JvmPauseMonitorSource { 030 031 String METRICS_NAME = "REST"; 032 033 String CONTEXT = "rest"; 034 035 String JMX_CONTEXT = "REST"; 036 037 String METRICS_DESCRIPTION = "Metrics about the HBase REST server"; 038 039 String REQUEST_KEY = "requests"; 040 041 String SUCCESSFUL_GET_KEY = "successfulGet"; 042 043 String SUCCESSFUL_PUT_KEY = "successfulPut"; 044 045 String SUCCESSFUL_DELETE_KEY = "successfulDelete"; 046 047 String FAILED_GET_KEY = "failedGet"; 048 049 String FAILED_PUT_KEY = "failedPut"; 050 051 String FAILED_DELETE_KEY = "failedDelete"; 052 053 String SUCCESSFUL_SCAN_KEY = "successfulScanCount"; 054 055 String FAILED_SCAN_KEY = "failedScanCount"; 056 057 String SUCCESSFUL_APPEND_KEY = "successfulAppendCount"; 058 059 String FAILED_APPEND_KEY = "failedAppendCount"; 060 061 String SUCCESSFUL_INCREMENT_KEY = "successfulIncrementCount"; 062 063 String FAILED_INCREMENT_KEY = "failedIncrementCount"; 064 065 /** 066 * Increment the number of requests 067 * 068 * @param inc Ammount to increment by 069 */ 070 void incrementRequests(int inc); 071 072 /** 073 * Increment the number of successful Get requests. 074 * 075 * @param inc Number of successful get requests. 076 */ 077 void incrementSucessfulGetRequests(int inc); 078 079 /** 080 * Increment the number of successful Put requests. 081 * 082 * @param inc Number of successful put requests. 083 */ 084 void incrementSucessfulPutRequests(int inc); 085 086 /** 087 * Increment the number of successful Delete requests. 088 * 089 * @param inc 090 */ 091 void incrementSucessfulDeleteRequests(int inc); 092 093 /** 094 * Increment the number of failed Put Requests. 095 * 096 * @param inc Number of failed Put requests. 097 */ 098 void incrementFailedPutRequests(int inc); 099 100 /** 101 * Increment the number of failed Get requests. 102 * 103 * @param inc The number of failed Get Requests. 104 */ 105 void incrementFailedGetRequests(int inc); 106 107 /** 108 * Increment the number of failed Delete requests. 109 * 110 * @param inc The number of failed delete requests. 111 */ 112 void incrementFailedDeleteRequests(int inc); 113 114 /** 115 * Increment the number of successful scan requests. 116 * 117 * @param inc Number of successful scan requests. 118 */ 119 void incrementSucessfulScanRequests(final int inc); 120 121 /** 122 * Increment the number failed scan requests. 123 * 124 * @param inc Number of failed scan requests. 125 */ 126 void incrementFailedScanRequests(final int inc); 127 128 /** 129 * Increment the number of successful append requests. 130 * 131 * @param inc Number of successful append requests. 132 */ 133 void incrementSucessfulAppendRequests(final int inc); 134 135 /** 136 * Increment the number failed append requests. 137 * 138 * @param inc Number of failed append requests. 139 */ 140 void incrementFailedAppendRequests(final int inc); 141 142 /** 143 * Increment the number of successful increment requests. 144 * 145 * @param inc Number of successful increment requests. 146 */ 147 void incrementSucessfulIncrementRequests(final int inc); 148 149 /** 150 * Increment the number failed increment requests. 151 * 152 * @param inc Number of failed increment requests. 153 */ 154 void incrementFailedIncrementRequests(final int inc); 155}