1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 24 /* 25 * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. 26 * Use is subject to license terms. 27 */ 28 29 /* 30 * $Id: ThreadPoolStats.java,v 1.2 2005/12/25 03:52:27 tcfujii Exp $ 31 * $Date: 2005/12/25 03:52:27 $ 32 * $Revision: 1.2 $ 33 */ 34 35 package com.sun.enterprise.admin.monitor.stats; 36 import javax.management.j2ee.statistics.Stats; 37 import javax.management.j2ee.statistics.CountStatistic; 38 import javax.management.j2ee.statistics.BoundedRangeStatistic; 39 import javax.management.j2ee.statistics.RangeStatistic; 40 41 /** 42 * Stats interface for the monitorable attributes of the 43 * a generic ThreadPool. This combines the statistics that were exposed in 7.0 44 * with the new ones. In 8.0, the generic Thread Pool that can be used by any component 45 * in the server runtime is introduced. 46 * @author Kedar Mhaswade 47 * @since S1AS8.0 48 * @version $Revision: 1.2 $ 49 */ 50 51 public interface ThreadPoolStats extends Stats { 52 53 /** Returns the statistical information about the number of Threads in the associated ThreaPool, as an instance of BoundedRangeStatistic. 54 * This returned value gives an idea about how the pool is changing. 55 * @return an instance of {@link BoundedRangeStatistic} 56 */ 57 public BoundedRangeStatistic getCurrentNumberOfThreads(); 58 59 /** Returns the total number of available threads, as an instance of {@link CountStatistic}. 60 * @return an instance of {@link CountStatistic} 61 */ 62 public CountStatistic getNumberOfAvailableThreads(); 63 64 /** Returns the number of busy threads, as an instance of {@link CountStatistic}. 65 * @return an instance of {@link CountStatistic} 66 */ 67 public CountStatistic getNumberOfBusyThreads(); 68 69 /** 70 * Returns the statistical information about the average completion time of a work item in milliseconds. 71 * @return an instance of {@link RangeStatistic} 72 */ 73 public RangeStatistic getAverageWorkCompletionTime(); 74 75 /** Returns the the total number of work items added so far to the work queue associated with threadpool. 76 * @return an instance of {@link CountStatistic} 77 */ 78 public CountStatistic getTotalWorkItemsAdded(); 79 80 /** 81 * Returns average time in milliseconds a work item waited in the work queue before getting processed. 82 * @return an instance of {@link RangeStatistic} 83 */ 84 public RangeStatistic getAverageTimeInQueue(); 85 } 86