You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by AlexLM <al...@gmail.com> on 2018/01/02 10:35:13 UTC
Total entries on cluster using metrics()
Hello,
I try to get the number of entries on 3 nodes inside a cluster. but when i
am doing :
Ignition.ignite().cache(CACHE_NAME).metrics().size()
I only get the size of the local cache, however i was thinking that
metrics() method returned the whole cluster statistics.
The ignite-config is the following :
<bean name="cacheConf"
class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="cache" />
<property name="cacheMode" value="PARTITIONED" />
<property name="backups" value="1" />
<property name="rebalanceMode" value="SYNC"/>
<property name="statisticsEnabled" value="true"/>
<property name="expiryPolicyFactory">
<bean id="expiryPolicy"
class="javax.cache.expiry.TouchedExpiryPolicy"
factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="SECONDS" />
<constructor-arg value="600" />
</bean>
</constructor-arg>
</bean>
</property>
</bean>
Appreciate your help, thanks !
AlexLM
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Total entries on cluster using metrics()
Posted by AlexLM <al...@gmail.com>.
Thank you for your prompt answer.
I found that the offHeapEntriesCnt is working for me (i only use the offHeap
memory strategy).
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Total entries on cluster using metrics()
Posted by Denis Mekhanikov <dm...@gmail.com>.
Hi Alex!
This is a known issue.
You can track its progress here:
https://issues.apache.org/jira/browse/IGNITE-6564
You can use IgniteCache#size()
<https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCache.html#size(org.apache.ignite.cache.CachePeekMode...)>
method as a workaround, but it implies higher overhead, so don't call this
method too often.
Denis
вт, 2 янв. 2018 г. в 13:35, AlexLM <al...@gmail.com>:
> Hello,
>
> I try to get the number of entries on 3 nodes inside a cluster. but when i
> am doing :
>
> Ignition.ignite().cache(CACHE_NAME).metrics().size()
>
> I only get the size of the local cache, however i was thinking that
> metrics() method returned the whole cluster statistics.
>
> The ignite-config is the following :
>
> <bean name="cacheConf"
> class="org.apache.ignite.configuration.CacheConfiguration">
> <property name="name" value="cache" />
> <property name="cacheMode" value="PARTITIONED" />
> <property name="backups" value="1" />
> <property name="rebalanceMode" value="SYNC"/>
> <property name="statisticsEnabled" value="true"/>
> <property name="expiryPolicyFactory">
> <bean id="expiryPolicy"
> class="javax.cache.expiry.TouchedExpiryPolicy"
> factory-method="factoryOf">
> <constructor-arg>
> <bean class="javax.cache.expiry.Duration">
> <constructor-arg value="SECONDS" />
> <constructor-arg value="600" />
> </bean>
> </constructor-arg>
> </bean>
> </property>
> </bean>
>
> Appreciate your help, thanks !
>
> AlexLM
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>