Statement cache monitoring

My earlier blog on Statement Caching described how PreparedStatement, CallableStatement, Statement objects are cached to provide performance improvement.


GlassFish maintains a statement cache to cache the statements that are repeatedly executed by applications. It is considered a cache hit when one of the statement objects from the cache is returned and a cache miss when the statement object is newly created as it was missing in the cache.


Now, the number of statement cache hits and misses can be monitored using the monitoring infrastructure of GlassFish. When statement-cache-size is set to a positive non zero number and monitoring is set to HIGH, the statement cache hit/miss statistics can be got using the command line interface.


A sample of the output is shown below.



server.resources.testPool.numstatementcachehit-count = 3
server.resources.testPool.numstatementcachemiss-count = 1


To get the monitoring statistics using AMX programmatically, use the following objectName


amx:pp=/mon/server-mon[server],type=jdbcra-mon,name=resources/testPool


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

shalini_m

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today