Cross sending this to dev.

Igniters, why does the metrics stuff have to be so confusing? Looks like if
"statisticsEnabled" is false, then metrics return all 0s. Can we at least
have a warning in the log stating that the metrics are disabled, and
explaining how to enable them?

D.

---------- Forwarded message ----------
From: Alper Tekinalp <al...@evam.com>
Date: Tue, Dec 20, 2016 at 3:10 AM
Subject: Re: Cache Metrics
To: u...@ignite.apache.org


Hi all.

Thanks for your replies. Enabling statistics fixed it.

On Tue, Dec 20, 2016 at 12:39 PM, Andrey Mashenkov <amashen...@gridgain.com>
wrote:

> Hi Alper,
>
> May be it is not obvious, but to enable offheap you need to
> setOffheapMaxMemory to zero (unlimited) or above zero.
> Also metrics is disabled by default, you need call
> setStatisticsEnabled(true);
>
> On Tue, Dec 20, 2016 at 11:41 AM, Alper Tekinalp <al...@evam.com> wrote:
>
>> Hi all.
>>
>> I have the following code:
>>         IgniteConfiguration igniteConfiguration = new
>> IgniteConfiguration();
>>         igniteConfiguration.setGridName("alper");
>>         Ignite start = Ignition.start(igniteConfiguration);
>>
>>         CacheConfiguration configuration = new CacheConfiguration();
>>         configuration.setAtomicityMode(CacheAtomicityMode.ATOMIC)
>>                 .setCacheMode(CacheMode.PARTITIONED)
>>                 .setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED)
>>                 .setRebalanceMode(CacheRebalanceMode.SYNC)
>>                 .setWriteSynchronizationMode(C
>> acheWriteSynchronizationMode.FULL_SYNC)
>>                 .setRebalanceThrottle(100)
>>                 .setRebalanceBatchSize(2*1024*1024)
>>                 .setBackups(1)
>>                 .setName("cemil")
>>                 .setEagerTtl(false);
>>         start.getOrCreateCache(configuration);
>>
>>         IgniteCache<Object, Object> cemil = start.getOrCreateCache("cemil"
>> );
>>
>>         cemil.put("1", "10");
>>         cemil.put("2", "10");
>>         cemil.put("3", "10");
>>         cemil.put("4", "10");
>>
>>         System.out.println(cemil.metrics().getOffHeapAllocatedSize());
>>         System.out.println(cemil.metrics().getOffHeapBackupEntriesCo
>> unt());
>>         System.out.println(cemil.metrics().getOffHeapGets());
>>         System.out.println(cemil.metrics().getOffHeapHits());
>>         System.out.println(cemil.metrics().getOffHeapMisses());
>>         System.out.println(cemil.metrics().getOffHeapPuts());
>>         System.out.println(cemil.metrics().getOffHeapEvictions());
>>         System.out.println(cemil.metrics().getOffHeapHitPercentage());
>>
>> All prints 0. Is that normal? Am i doing something wrong?
>>
>> --
>> Alper Tekinalp
>>
>> Software Developer
>> Evam Streaming Analytics
>>
>> Atatürk Mah. Turgut Özal Bulv.
>> Gardenya 5 Plaza K:6 Ataşehir
>> 34758 İSTANBUL
>>
>> Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
>> www.evam.com.tr
>> <http://www.evam.com>
>>
>
>


-- 
Alper Tekinalp

Software Developer
Evam Streaming Analytics

Atatürk Mah. Turgut Özal Bulv.
Gardenya 5 Plaza K:6 Ataşehir
34758 İSTANBUL

Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
www.evam.com.tr
<http://www.evam.com>

Reply via email to