ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alper Tekinalp <al...@evam.com>
Subject Cache Metrics
Date Tue, 20 Dec 2016 08:41:41 GMT
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>

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