How to control GlassFish stream flow through asadmin interface

I am trying to use the asadmin interface to monitor a thread pool on GlassFish 3.1.1. I execute the following command:

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

and I get the data back, but most of them have lastsampletime = -1 (so the associated data is zero and not meaningful).

Note. I also tried the REST interface, which I consider asadmin delegate, and the JMX interface. Same problem: most of the data has lastsampletime = -1.

I have already enabled monitoring for HIGH for all modules. What am I missing?

+4
source share
3 answers

It seems that redeploying my application was necessary so that the monitoring actually got the values. I may have misinterpreted this guide, but it doesn't seem to require a restart / redeployment:

Oracle GlassFish Server 3.1 Administration Guide

In addition, it is strange that the following shows that there is no monitoring data:

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

Instead, you should go through a specific network listener, for example:

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

It also seemed to me that enabling thread pool monitoring was not enough to view thread pool statistics. You should also enable http service monitoring:

 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 
+6
source

That is all you have to do.

  • Enable monitoring, set HIGH , for the http-service module in the DAS, stand-alone instance or cluster that you want to monitor.
  • Deploy the application for a DAS, standalone instance, or cluster and make http requests.
  • asadmin get -m *instancename*.network.*listener*.thread-pool.*

You seem to be in control of the DAS as you are using asadmin get -m server.network.my-listener.thread-pool.*.

I launched a simple war with DAS and made a bunch of http requests. I see that the counter corethreads-count and maxthreads-count have a recent fetch time of -1. And the remaining statistics have the actual last sampling times.

 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. 
+5
source

To enable monitoring instantly without restarting, use the enable-monitoring command

 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 

The trick is that there must be a high level for the thread pool and http-service modules to receive monitoring information.

See https://docs.oracle.com/cd/E26576_01/doc.312/e24928/monitoring.htm#GSADG00558 for details

0
source

Source: https://habr.com/ru/post/1379364/


All Articles