使用EhCache在生产中缓存的对象数 [英] Number of objects cached in production using EhCache

查看:65
本文介绍了使用EhCache在生产中缓存的对象数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以知道生产中缓存的对象数量吗?

我在我的项目上使用EhCache,并在NewRelic上进行监视.

我不知道这是否对我有帮助,或者NewRelic是否与EhCache集成.

解决方案

您可能会使用NewRelic的JMX集成,但是还有如此处所述.

有一个很好的Spring Boot示例 解决方案

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

这篇关于使用EhCache在生产中缓存的对象数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆