@WebListener public class CacheMonitor extends JmxMonitor implements CacheMonitorMXBean
Constructor and Description |
---|
CacheMonitor() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent) |
void |
contextInitialized(javax.servlet.ServletContextEvent servletContextEvent) |
long |
getCacheSize()
Returns the number of entries in all monitored caches.
|
List<CacheStats> |
getCacheStatsList()
Returns a list containing a
CacheStats instance for each monitored cache. |
long |
getEvictionCount()
Returns the number of times an entry has been automatically evicted.
|
long |
getHitCount()
Returns the number times cache lookup methods have returned a cached value.
|
static CacheMonitor |
getInstance() |
long |
getLoadExceptionCount()
Returns the number of times cache lookup methods threw an exception while loading a new value.
|
long |
getLoadSuccessCount()
Returns the number of times cache lookup methods have successfully loaded a new value.
|
long |
getMissCount()
Returns the number of times cache lookup methods have returned an uncached value, or null.
|
long |
getTotalLoadTime()
Returns the total number of nanoseconds the cache has spent loading new values.
|
long |
invalidateCaches()
Invalidates all entries in all caches.
|
long |
invalidateTenantCaches(String tenantId)
Invalidates all caches of the given tenant.
|
long |
invalidateUserCaches(String tenantId,
String userName)
Invalidates all caches of the given user.
|
registerJmxBean, unregisterJmxBean
public long invalidateCaches()
CacheMonitorMXBean
invalidateCaches
in interface CacheMonitorMXBean
public long invalidateTenantCaches(String tenantId)
CacheMonitorMXBean
invalidateTenantCaches
in interface CacheMonitorMXBean
tenantId
- The tenant to invalidate all caches for.public long invalidateUserCaches(String tenantId, String userName)
CacheMonitorMXBean
invalidateUserCaches
in interface CacheMonitorMXBean
tenantId
- The Id of the tenant for which all user caches should be invalidated.userName
- The name of the user for which all caches should be invalidated.public long getCacheSize()
CacheMonitorMXBean
getCacheSize
in interface CacheMonitorMXBean
public long getHitCount()
CacheMonitorMXBean
getHitCount
in interface CacheMonitorMXBean
public long getMissCount()
CacheMonitorMXBean
getMissCount
in interface CacheMonitorMXBean
public long getLoadSuccessCount()
CacheMonitorMXBean
getLoadSuccessCount
in interface CacheMonitorMXBean
public long getLoadExceptionCount()
CacheMonitorMXBean
getLoadExceptionCount
in interface CacheMonitorMXBean
public long getTotalLoadTime()
CacheMonitorMXBean
getTotalLoadTime
in interface CacheMonitorMXBean
public long getEvictionCount()
CacheMonitorMXBean
getEvictionCount
in interface CacheMonitorMXBean
public List<CacheStats> getCacheStatsList()
CacheMonitorMXBean
CacheStats
instance for each monitored cache.getCacheStatsList
in interface CacheMonitorMXBean
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
contextInitialized
in interface javax.servlet.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
contextDestroyed
in interface javax.servlet.ServletContextListener
public static CacheMonitor getInstance()
Copyright © 2018 SAP SE. All rights reserved.