1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.apache.hadoop.hbase.regionserver; 20 21 import java.util.Map; 22 23 import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; 24 25 /** 26 * Interface of class that will wrap an HRegion and export numbers so they can be 27 * used in MetricsRegionSource 28 */ 29 public interface MetricsRegionWrapper { 30 31 /** 32 * Get the name of the table the region belongs to. 33 * 34 * @return The string version of the table name. 35 */ 36 String getTableName(); 37 38 /** 39 * Get the name of the namespace this table is in. 40 * @return String version of the namespace. Can't be empty. 41 */ 42 String getNamespace(); 43 44 /** 45 * Get the name of the region. 46 * 47 * @return The encoded name of the region. 48 */ 49 String getRegionName(); 50 51 /** 52 * Get the number of stores hosted on this region server. 53 */ 54 long getNumStores(); 55 56 /** 57 * Get the number of store files hosted on this region server. 58 */ 59 long getNumStoreFiles(); 60 61 /** 62 * Get the size of the memstore on this region server. 63 */ 64 long getMemstoreSize(); 65 66 /** 67 * Get the total size of the store files this region server is serving from. 68 */ 69 long getStoreFileSize(); 70 71 /** 72 * Get the total number of read requests that have been issued against this region 73 */ 74 long getReadRequestCount(); 75 76 /** 77 * Get the total number of mutations that have been issued against this region. 78 */ 79 long getWriteRequestCount(); 80 81 long getNumFilesCompacted(); 82 83 long getNumBytesCompacted(); 84 85 long getNumCompactionsCompleted(); 86 87 /** 88 * Get the time spent by coprocessors in this region. 89 */ 90 Map<String, DescriptiveStatistics> getCoprocessorExecutionStatistics(); 91 }