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.master;
020
021import org.apache.hadoop.hbase.metrics.BaseSource;
022import org.apache.hadoop.hbase.metrics.OperationMetrics;
023import org.apache.yetus.audience.InterfaceAudience;
024
025/**
026 * Interface that classes that expose metrics about the master will implement.
027 */
028@InterfaceAudience.Private
029public interface MetricsMasterSource extends BaseSource {
030
031  /**
032   * The name of the metrics
033   */
034  String METRICS_NAME = "Server";
035
036  /**
037   * The context metrics will be under.
038   */
039  String METRICS_CONTEXT = "master";
040
041  /**
042   * The name of the metrics context that metrics will be under in jmx
043   */
044  String METRICS_JMX_CONTEXT = "Master,sub=" + METRICS_NAME;
045
046  /**
047   * Description
048   */
049  String METRICS_DESCRIPTION = "Metrics about HBase master server";
050
051  // Strings used for exporting to metrics system.
052  String MASTER_ACTIVE_TIME_NAME = "masterActiveTime";
053  String MASTER_START_TIME_NAME = "masterStartTime";
054  String MASTER_FINISHED_INITIALIZATION_TIME_NAME = "masterFinishedInitializationTime";
055  String AVERAGE_LOAD_NAME = "averageLoad";
056  String LIVE_REGION_SERVERS_NAME = "liveRegionServers";
057  String DEAD_REGION_SERVERS_NAME = "deadRegionServers";
058  String NUM_REGION_SERVERS_NAME = "numRegionServers";
059  String NUM_DEAD_REGION_SERVERS_NAME = "numDeadRegionServers";
060  String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
061  String SERVER_NAME_NAME = "serverName";
062  String CLUSTER_ID_NAME = "clusterId";
063  String IS_ACTIVE_MASTER_NAME = "isActiveMaster";
064  String SPLIT_PLAN_COUNT_NAME = "splitPlanCount";
065  String MERGE_PLAN_COUNT_NAME = "mergePlanCount";
066
067  String CLUSTER_REQUESTS_NAME = "clusterRequests";
068  String MASTER_ACTIVE_TIME_DESC = "Master Active Time";
069  String MASTER_START_TIME_DESC = "Master Start Time";
070  String MASTER_FINISHED_INITIALIZATION_TIME_DESC = "Timestamp when Master has finished initializing";
071  String AVERAGE_LOAD_DESC = "AverageLoad";
072  String LIVE_REGION_SERVERS_DESC = "Names of live RegionServers";
073  String NUMBER_OF_REGION_SERVERS_DESC = "Number of RegionServers";
074  String DEAD_REGION_SERVERS_DESC = "Names of dead RegionServers";
075  String NUMBER_OF_DEAD_REGION_SERVERS_DESC = "Number of dead RegionServers";
076  String ZOOKEEPER_QUORUM_DESC = "ZooKeeper Quorum";
077  String SERVER_NAME_DESC = "Server Name";
078  String CLUSTER_ID_DESC = "Cluster Id";
079  String IS_ACTIVE_MASTER_DESC = "Is Active Master";
080  String SPLIT_PLAN_COUNT_DESC = "Number of Region Split Plans executed";
081  String MERGE_PLAN_COUNT_DESC = "Number of Region Merge Plans executed";
082
083  String SERVER_CRASH_METRIC_PREFIX = "serverCrash";
084
085  /**
086   * Increment the number of requests the cluster has seen.
087   *
088   * @param inc Ammount to increment the total by.
089   */
090  void incRequests(final long inc);
091
092  /**
093   * @return {@link OperationMetrics} containing common metrics for server crash operation
094   */
095  OperationMetrics getServerCrashMetrics();
096}