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.regionserver;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * Latency metrics for a specific table in a RegionServer.
024 */
025@InterfaceAudience.Private
026public interface MetricsTableLatencies {
027
028  /**
029   * The name of the metrics
030   */
031  String METRICS_NAME = "TableLatencies";
032
033  /**
034   * The name of the metrics context that metrics will be under.
035   */
036  String METRICS_CONTEXT = "regionserver";
037
038  /**
039   * Description
040   */
041  String METRICS_DESCRIPTION = "Metrics about Tables on a single HBase RegionServer";
042
043  /**
044   * The name of the metrics context that metrics will be under in jmx
045   */
046  String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
047
048  String GET_TIME = "getTime";
049  String SCAN_TIME = "scanTime";
050  String SCAN_SIZE = "scanSize";
051  String PUT_TIME = "putTime";
052  String PUT_BATCH_TIME = "putBatchTime";
053  String DELETE_TIME = "deleteTime";
054  String DELETE_BATCH_TIME = "deleteBatchTime";
055  String INCREMENT_TIME = "incrementTime";
056  String APPEND_TIME = "appendTime";
057  String CHECK_AND_DELETE_TIME = "checkAndDeleteTime";
058  String CHECK_AND_PUT_TIME = "checkAndPutTime";
059  String CHECK_AND_MUTATE_TIME = "checkAndMutateTime";
060
061  /**
062   * Update the Put time histogram
063   * @param tableName The table the metric is for
064   * @param t         time it took
065   */
066  void updatePut(String tableName, long t);
067
068  /**
069   * Update the batch Put time histogram
070   * @param tableName The table the metric is for
071   * @param t         time it took
072   */
073  void updatePutBatch(String tableName, long t);
074
075  /**
076   * Update the Delete time histogram
077   * @param tableName The table the metric is for
078   * @param t         time it took
079   */
080  void updateDelete(String tableName, long t);
081
082  /**
083   * Update the batch Delete time histogram
084   * @param tableName The table the metric is for
085   * @param t         time it took
086   */
087  void updateDeleteBatch(String tableName, long t);
088
089  /**
090   * Update the Get time histogram .
091   * @param tableName The table the metric is for
092   * @param t         time it took
093   */
094  void updateGet(String tableName, long t);
095
096  /**
097   * Update the Increment time histogram.
098   * @param tableName The table the metric is for
099   * @param t         time it took
100   */
101  void updateIncrement(String tableName, long t);
102
103  /**
104   * Update the Append time histogram.
105   * @param tableName The table the metric is for
106   * @param t         time it took
107   */
108  void updateAppend(String tableName, long t);
109
110  /**
111   * Update the scan size.
112   * @param tableName The table the metric is for
113   * @param scanSize  size of the scan
114   */
115  void updateScanSize(String tableName, long scanSize);
116
117  /**
118   * Update the scan time.
119   * @param tableName The table the metric is for
120   * @param t         time it took
121   */
122  void updateScanTime(String tableName, long t);
123
124  /**
125   * Update the CheckAndDelete time histogram.
126   * @param nameAsString The table the metric is for
127   * @param time         time it took
128   */
129  void updateCheckAndDelete(String nameAsString, long time);
130
131  /**
132   * Update the CheckAndPut time histogram.
133   * @param nameAsString The table the metric is for
134   * @param time         time it took
135   */
136  void updateCheckAndPut(String nameAsString, long time);
137
138  /**
139   * Update the CheckAndMutate time histogram.
140   * @param nameAsString The table the metric is for
141   * @param time         time it took
142   */
143  void updateCheckAndMutate(String nameAsString, long time);
144
145}