2011-11-02 43 views
4

我正在嘗試使用asadmin界面監控GlassFish 3.1.1上的線程池。我執行以下命令:如何通過asadmin界面監控GlassFish線程池

asadmin get -m server.network.my-listener.thread-pool.* 

和我得到的數據備份,但大部分已lastsampletime = -1(所以相關數據爲零;和不值錢)。

注意:我也嘗試了我認爲asadmin委託給的REST接口和JMX接口。同樣的問題:大部分數據的lastsampletime = -1。

我已經將所有模塊的監視轉爲高。我錯過了什麼?

回答

6

似乎重新部署我的應用程序是必要的監測實際上獲取值。也許我解釋手動錯誤,但它似乎表明,重新啓動/重新部署將不需要:

Oracle GlassFish Server 3.1 Administration Guide

而且,奇怪的是,下面的節目沒有監測數據:

asadmin get -m server.thread-pools.thread-pool.http-thread-pool.* 

相反,你必須通過一個特定的網絡監聽器,如:

asadmin get -m server.network.http-listener-2.thread-pool.* 

這也讓我驚訝的是使線程-PO ol監視不足以查看線程池統計信息。您還必須啓用HTTP服務監測:

asadmin enable-monitoring 
asadmin set server.monitoring-service.module-monitoring-levels.thread-pool=HIGH 
asadmin set server.monitoring-service.module-monitoring-levels.http-service=HIGH 
+0

我沒有再認識這個問題,並找到了答案,第二次。抱歉,我不能再次投票,但非常感謝您的問題和答案@Ryan! – jan

5

這就是你應該做的所有事情。

  1. 對於要監視的DAS上的http-service模塊,獨立實例或羣集,啓用監視,設置爲HIGH
  2. 將應用程序部署到DAS,獨立實例或羣集併發出http請求。
  3. asadmin get -m *instancename*.network.*listener*.thread-pool.*

看起來你正在監視DAS,因爲你正在使用asadmin get -m server.network.my-listener.thread-pool.*.

我部署一個簡單的戰爭DAS,並提出了一大堆的HTTP請求。我看到corethreads-count和maxthreads-count的最後一個採樣時間爲-1。而其餘的統計數據有實際的最後採樣時間。

asadmin get -m "server.network.http-listener-1.thread-pool.*" 
server.network.http-listener-1.thread-pool.corethreads-count = 0 
server.network.http-listener-1.thread-pool.corethreads-description = Core number of threads in the thread pool 
server.network.http-listener-1.thread-pool.corethreads-lastsampletime = -1 
server.network.http-listener-1.thread-pool.corethreads-name = CoreThreads 
server.network.http-listener-1.thread-pool.corethreads-starttime = 1320764890444 
server.network.http-listener-1.thread-pool.corethreads-unit = count 
server.network.http-listener-1.thread-pool.currentthreadcount-count = 5 
server.network.http-listener-1.thread-pool.currentthreadcount-description = Provides the number of request processing threads currently in the listener thread pool 
server.network.http-listener-1.thread-pool.currentthreadcount-lastsampletime = 1320765351708 
server.network.http-listener-1.thread-pool.currentthreadcount-name = CurrentThreadCount 
server.network.http-listener-1.thread-pool.currentthreadcount-starttime = 1320764890445 
server.network.http-listener-1.thread-pool.currentthreadcount-unit = count 
server.network.http-listener-1.thread-pool.currentthreadsbusy-count = 0 
server.network.http-listener-1.thread-pool.currentthreadsbusy-description = Provides the number of request processing threads currently in use in the listener thread pool serving requests 
server.network.http-listener-1.thread-pool.currentthreadsbusy-lastsampletime = 1320765772814 
server.network.http-listener-1.thread-pool.currentthreadsbusy-name = CurrentThreadsBusy 
server.network.http-listener-1.thread-pool.currentthreadsbusy-starttime = 1320764890445 
server.network.http-listener-1.thread-pool.currentthreadsbusy-unit = count 
server.network.http-listener-1.thread-pool.dotted-name = server.network.http-listener-1.thread-pool 
server.network.http-listener-1.thread-pool.maxthreads-count = 0 
server.network.http-listener-1.thread-pool.maxthreads-description = Maximum number of threads allowed in the thread pool 
server.network.http-listener-1.thread-pool.maxthreads-lastsampletime = -1 
server.network.http-listener-1.thread-pool.maxthreads-name = MaxThreads 
server.network.http-listener-1.thread-pool.maxthreads-starttime = 1320764890443 
server.network.http-listener-1.thread-pool.maxthreads-unit = count 
server.network.http-listener-1.thread-pool.totalexecutedtasks-count = 31 
server.network.http-listener-1.thread-pool.totalexecutedtasks-description = Provides the total number of tasks, which were executed by the thread pool 
server.network.http-listener-1.thread-pool.totalexecutedtasks-lastsampletime = 1320765772814 
server.network.http-listener-1.thread-pool.totalexecutedtasks-name = TotalExecutedTasksCount 
server.network.http-listener-1.thread-pool.totalexecutedtasks-starttime = 1320764890444 
server.network.http-listener-1.thread-pool.totalexecutedtasks-unit = count 

Command get executed successfully. 
0

上能夠使監控無重新使用能夠監控命令

enable-monitoring 
enable-monitoring --modules jvm=LOW 
enable-monitoring --modules thread-pool=HIGH 
enable-monitoring --modules http-service=HIGH 
enable-monitoring --modules jdbc-connection-pool=HIGH 

訣竅是,線程池和HTTP的服務模塊必須具有較高水平獲取監控信息。

欲瞭解更多信息請參閱https://docs.oracle.com/cd/E26576_01/doc.312/e24928/monitoring.htm#GSADG00558