ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Kuznetsov <akuznet...@apache.org>
Subject Re: Cache Metrics
Date Tue, 20 Dec 2016 08:54:57 GMT
Hi, Alper!

Could you try to set configuration.setStatisticsEnabled(true)  and try once
again?

On Tue, Dec 20, 2016 at 3:41 PM, Alper Tekinalp <alper@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(CacheWriteSynchronizationMode.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().getOffHeapBackupEntriesCount()
> );
>         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>
>



-- 
Alexey Kuznetsov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message