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 */ 018package org.apache.hadoop.hbase.rest; 019 020import org.apache.hadoop.hbase.metrics.BaseSource; 021import org.apache.hadoop.hbase.metrics.JvmPauseMonitorSource; 022import org.apache.yetus.audience.InterfaceAudience; 023 024/** 025 * Interface of the Metrics Source that will export data to Hadoop's Metrics2 system. 026 */ 027@InterfaceAudience.Private 028public interface MetricsRESTSource extends BaseSource, JvmPauseMonitorSource { 029 030 String METRICS_NAME = "REST"; 031 032 String CONTEXT = "rest"; 033 034 String JMX_CONTEXT = "REST"; 035 036 String METRICS_DESCRIPTION = "Metrics about the HBase REST server"; 037 038 String REQUEST_KEY = "requests"; 039 040 String SUCCESSFUL_GET_KEY = "successfulGet"; 041 042 String SUCCESSFUL_PUT_KEY = "successfulPut"; 043 044 String SUCCESSFUL_DELETE_KEY = "successfulDelete"; 045 046 String FAILED_GET_KEY = "failedGet"; 047 048 String FAILED_PUT_KEY = "failedPut"; 049 050 String FAILED_DELETE_KEY = "failedDelete"; 051 052 String SUCCESSFUL_SCAN_KEY = "successfulScanCount"; 053 054 String FAILED_SCAN_KEY = "failedScanCount"; 055 056 String SUCCESSFUL_APPEND_KEY = "successfulAppendCount"; 057 058 String FAILED_APPEND_KEY = "failedAppendCount"; 059 060 String SUCCESSFUL_INCREMENT_KEY = "successfulIncrementCount"; 061 062 String FAILED_INCREMENT_KEY = "failedIncrementCount"; 063 064 /** 065 * Increment the number of requests 066 * @param inc Ammount to increment by 067 */ 068 void incrementRequests(int inc); 069 070 /** 071 * Increment the number of successful Get requests. 072 * @param inc Number of successful get requests. 073 */ 074 void incrementSucessfulGetRequests(int inc); 075 076 /** 077 * Increment the number of successful Put requests. 078 * @param inc Number of successful put requests. 079 */ 080 void incrementSucessfulPutRequests(int inc); 081 082 /** 083 * Increment the number of successful Delete requests. 084 * @param inc number of successful delete requests 085 */ 086 void incrementSucessfulDeleteRequests(int inc); 087 088 /** 089 * Increment the number of failed Put Requests. 090 * @param inc Number of failed Put requests. 091 */ 092 void incrementFailedPutRequests(int inc); 093 094 /** 095 * Increment the number of failed Get requests. 096 * @param inc The number of failed Get Requests. 097 */ 098 void incrementFailedGetRequests(int inc); 099 100 /** 101 * Increment the number of failed Delete requests. 102 * @param inc The number of failed delete requests. 103 */ 104 void incrementFailedDeleteRequests(int inc); 105 106 /** 107 * Increment the number of successful scan requests. 108 * @param inc Number of successful scan requests. 109 */ 110 void incrementSucessfulScanRequests(final int inc); 111 112 /** 113 * Increment the number failed scan requests. 114 * @param inc Number of failed scan requests. 115 */ 116 void incrementFailedScanRequests(final int inc); 117 118 /** 119 * Increment the number of successful append requests. 120 * @param inc Number of successful append requests. 121 */ 122 void incrementSucessfulAppendRequests(final int inc); 123 124 /** 125 * Increment the number failed append requests. 126 * @param inc Number of failed append requests. 127 */ 128 void incrementFailedAppendRequests(final int inc); 129 130 /** 131 * Increment the number of successful increment requests. 132 * @param inc Number of successful increment requests. 133 */ 134 void incrementSucessfulIncrementRequests(final int inc); 135 136 /** 137 * Increment the number failed increment requests. 138 * @param inc Number of failed increment requests. 139 */ 140 void incrementFailedIncrementRequests(final int inc); 141}