001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to you under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.hadoop.hbase.regionserver;
018
019import org.apache.yetus.audience.InterfaceAudience;
020
021/**
022 * Latency metrics for a specific table in a RegionServer.
023 */
024@InterfaceAudience.Private
025public interface MetricsTableLatencies {
026
027  /**
028   * The name of the metrics
029   */
030  String METRICS_NAME = "TableLatencies";
031
032  /**
033   * The name of the metrics context that metrics will be under.
034   */
035  String METRICS_CONTEXT = "regionserver";
036
037  /**
038   * Description
039   */
040  String METRICS_DESCRIPTION = "Metrics about Tables on a single HBase RegionServer";
041
042  /**
043   * The name of the metrics context that metrics will be under in jmx
044   */
045  String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
046
047  String GET_TIME = "getTime";
048  String SCAN_TIME = "scanTime";
049  String SCAN_SIZE = "scanSize";
050  String PUT_TIME = "putTime";
051  String PUT_BATCH_TIME = "putBatchTime";
052  String DELETE_TIME = "deleteTime";
053  String DELETE_BATCH_TIME = "deleteBatchTime";
054  String INCREMENT_TIME = "incrementTime";
055  String APPEND_TIME = "appendTime";
056  String CHECK_AND_DELETE_TIME = "checkAndDeleteTime";
057  String CHECK_AND_PUT_TIME = "checkAndPutTime";
058  String CHECK_AND_MUTATE_TIME = "checkAndMutateTime";
059
060  /**
061   * Update the Put time histogram
062   *
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   *
071   * @param tableName The table the metric is for
072   * @param t time it took
073   */
074  void updatePutBatch(String tableName, long t);
075
076  /**
077   * Update the Delete time histogram
078   *
079   * @param tableName The table the metric is for
080   * @param t time it took
081   */
082  void updateDelete(String tableName, long t);
083
084  /**
085   * Update the batch Delete time histogram
086   *
087   * @param tableName The table the metric is for
088   * @param t time it took
089   */
090  void updateDeleteBatch(String tableName, long t);
091
092  /**
093   * Update the Get time histogram .
094   *
095   * @param tableName The table the metric is for
096   * @param t time it took
097   */
098  void updateGet(String tableName, long t);
099
100  /**
101   * Update the Increment time histogram.
102   *
103   * @param tableName The table the metric is for
104   * @param t time it took
105   */
106  void updateIncrement(String tableName, long t);
107
108  /**
109   * Update the Append time histogram.
110   *
111   * @param tableName The table the metric is for
112   * @param t time it took
113   */
114  void updateAppend(String tableName, long t);
115
116  /**
117   * Update the scan size.
118   *
119   * @param tableName The table the metric is for
120   * @param scanSize size of the scan
121   */
122  void updateScanSize(String tableName, long scanSize);
123
124  /**
125   * Update the scan time.
126   *
127   * @param tableName The table the metric is for
128   * @param t time it took
129   */
130  void updateScanTime(String tableName, long t);
131
132  /**
133   * Update the CheckAndDelete time histogram.
134   * @param nameAsString The table the metric is for
135   * @param time time it took
136   */
137  void updateCheckAndDelete(String nameAsString, long time);
138
139  /**
140   * Update the CheckAndPut time histogram.
141   * @param nameAsString The table the metric is for
142   * @param time time it took
143   */
144  void updateCheckAndPut(String nameAsString, long time);
145
146  /**
147   * Update the CheckAndMutate time histogram.
148   * @param nameAsString The table the metric is for
149   * @param time time it took
150   */
151  void updateCheckAndMutate(String nameAsString, long time);
152
153}