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 package com.sun.enterprise.admin.monitor.stats; 30 import javax.management.j2ee.statistics.Stats; 31 import javax.management.j2ee.statistics.CountStatistic; 32 import com.sun.enterprise.admin.monitor.stats.StringStatistic; 33 34 /** 35 * A Stats interface, to expose the monitoring information 36 * about the thread system of the JVM. 37 * @since 8.1 38 */ 39 public interface JVMThreadStats extends Stats { 40 41 /** 42 * Returns the current number of live daemon and non-daemon 43 * threads 44 * @return CountStatistic current number of live threads 45 */ 46 public CountStatistic getThreadCount(); 47 48 /** 49 * Returns the peak live thread count, since the JVM started or 50 * the peak was reset 51 * @return CountStatistic peak live thread count 52 */ 53 public CountStatistic getPeakThreadCount(); 54 55 /** 56 * Returns the total number of threads created and also started 57 * since the JVM started 58 * @return CountStatistic total number of threads started 59 */ 60 public CountStatistic getTotalStartedThreadCount(); 61 62 /** 63 * Returns the current number of live daemon threads 64 * @return CountStatistic current number of live daemon threads 65 */ 66 public CountStatistic getDaemonThreadCount(); 67 68 /** 69 * Returns a comma separated list of all live thread ids 70 * @return StringStatistic live thread ids 71 */ 72 public StringStatistic getAllThreadIds(); 73 74 /** 75 * Returns the CPU time for the current thread in nanoseconds, if 76 * CPU time measurement is enabled. Else returns -1 77 * @return CountStatistic CPU time for the current thread 78 */ 79 public CountStatistic getCurrentThreadCPUTime(); 80 81 /** 82 * Returns a comma separated list of thread ids that are 83 * monitor deadlocked 84 * @return StringStatistic 85 */ 86 public StringStatistic getMonitorDeadlockedThreads(); 87 88 } 89