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.hadoop.hbase.metrics.BaseSource; 020import org.apache.yetus.audience.InterfaceAudience; 021 022/** 023 * A collection of exposed metrics for space quotas from an HBase RegionServer. 024 */ 025@InterfaceAudience.Private 026public interface MetricsRegionServerQuotaSource extends BaseSource { 027 028 String METRICS_NAME = "Quotas"; 029 String METRICS_CONTEXT = "regionserver"; 030 String METRICS_DESCRIPTION = "Metrics about HBase RegionServer Quotas"; 031 String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME; 032 033 /** 034 * Updates the metric tracking how many tables this RegionServer has marked as in violation 035 * of their space quota. 036 */ 037 void updateNumTablesInSpaceQuotaViolation(long tablesInViolation); 038 039 /** 040 * Updates the metric tracking how many tables this RegionServer has received 041 * {@code SpaceQuotaSnapshot}s for. 042 * 043 * @param numSnapshots The number of {@code SpaceQuotaSnapshot}s received from the Master. 044 */ 045 void updateNumTableSpaceQuotaSnapshots(long numSnapshots); 046 047 /** 048 * Updates the metric tracking how much time was spent scanning the filesystem to compute 049 * the size of each region hosted by this RegionServer. 050 * 051 * @param time The execution time of the chore in milliseconds. 052 */ 053 void incrementSpaceQuotaFileSystemScannerChoreTime(long time); 054 055 /** 056 * Updates the metric tracking how much time was spent updating the RegionServer with the 057 * latest information on space quotas from the {@code hbase:quota} table. 058 * 059 * @param time The execution time of the chore in milliseconds. 060 */ 061 void incrementSpaceQuotaRefresherChoreTime(long time); 062}