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. n
084   */
085  void incrementSucessfulDeleteRequests(int inc);
086
087  /**
088   * Increment the number of failed Put Requests.
089   * @param inc Number of failed Put requests.
090   */
091  void incrementFailedPutRequests(int inc);
092
093  /**
094   * Increment the number of failed Get requests.
095   * @param inc The number of failed Get Requests.
096   */
097  void incrementFailedGetRequests(int inc);
098
099  /**
100   * Increment the number of failed Delete requests.
101   * @param inc The number of failed delete requests.
102   */
103  void incrementFailedDeleteRequests(int inc);
104
105  /**
106   * Increment the number of successful scan requests.
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   * @param inc Number of failed scan requests.
114   */
115  void incrementFailedScanRequests(final int inc);
116
117  /**
118   * Increment the number of successful append requests.
119   * @param inc Number of successful append requests.
120   */
121  void incrementSucessfulAppendRequests(final int inc);
122
123  /**
124   * Increment the number failed append requests.
125   * @param inc Number of failed append requests.
126   */
127  void incrementFailedAppendRequests(final int inc);
128
129  /**
130   * Increment the number of successful increment requests.
131   * @param inc Number of successful increment requests.
132   */
133  void incrementSucessfulIncrementRequests(final int inc);
134
135  /**
136   * Increment the number failed increment requests.
137   * @param inc Number of failed increment requests.
138   */
139  void incrementFailedIncrementRequests(final int inc);
140}