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.metrics;
020
021import org.apache.yetus.audience.InterfaceAudience;
022
023/**
024 * Interface for sources that will export JvmPauseMonitor metrics
025 */
026@InterfaceAudience.Private
027public interface JvmPauseMonitorSource  {
028
029  String INFO_THRESHOLD_COUNT_KEY = "pauseInfoThresholdExceeded";
030  String INFO_THRESHOLD_COUNT_DESC = "Count of INFO level pause threshold alerts";
031  String WARN_THRESHOLD_COUNT_KEY = "pauseWarnThresholdExceeded";
032  String WARN_THRESHOLD_COUNT_DESC = "Count of WARN level pause threshold alerts";
033
034  String PAUSE_TIME_WITH_GC_KEY = "pauseTimeWithGc";
035  String PAUSE_TIME_WITH_GC_DESC = "Histogram for excessive pause times with GC activity detected";
036
037  String PAUSE_TIME_WITHOUT_GC_KEY = "pauseTimeWithoutGc";
038  String PAUSE_TIME_WITHOUT_GC_DESC =
039      "Histogram for excessive pause times without GC activity detected";
040
041  /**
042   * Increment the INFO level threshold exceeded count
043   * @param count the count
044   */
045  void incInfoThresholdExceeded(int count);
046
047  /**
048   * Increment the WARN level threshold exceeded count
049   * @param count the count
050   */
051  void incWarnThresholdExceeded(int count);
052
053  /**
054   * Update the pause time histogram where GC activity was detected.
055   *
056   * @param t time it took
057   */
058  void updatePauseTimeWithGc(long t);
059
060  /**
061   * Update the pause time histogram where GC activity was not detected.
062   *
063   * @param t time it took
064   */
065  void updatePauseTimeWithoutGc(long t);
066}