Number of objects cached in production using EhCache

僤鯓⒐⒋嵵緔 提交于 2020-12-13 03:23:05

问题


Is there any way to know the number of objects cached in production?

I am using EhCache on my project and NewRelic for monitoring.

I don't know if that help me too or if there is integration for NewRelic with EhCache.


回答1:


You could potentially use NewRelic's JMX integration, but also there is JCache API integration in NewRelic, which may instrument the right parts if you are using the JCache compatible features of EhCache.

If you want to export select JMX information, then you need to specify in your NewRelic config on the server as documented here.

For example you could create the following file in /opt/newrelic/extension/ehcache.yaml

name: EhCacheMetrics
version: 1.0
enabled: true
jmx:
  - object_name: {see Metadata within VisualVM MBeans browser}
    metrics:
      - attributes: CacheHitPercentage, CacheHits, CacheMisses, ObjectCount
        type: simple

You'll need to find out what is available which you can do by registering EhCache for JMX management as documented here.

There is a good Spring Boot sample here



来源:https://stackoverflow.com/questions/64752263/number-of-objects-cached-in-production-using-ehcache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!