Şu satırı dahil ederiz
import com.hazelcast.core.EntryView;
Açıklaması şöyle. Yani etkinleştirmek gerekir. Eğer etkin değilse -1 döner.
To get statistics for a specific map entry, you can use the getEntryView(key) method of one of the following available client libraries. To use this method, the map must have its per-entry-stats-enabled element set to true.
getEntryView() metodu hem member hem de istemci tarafında kullanılabilir
Örnek
Şöyle yaparız
HazelcastInstance hz = HazelcastClient.newHazelcastClient();
EntryView entry = hz.getMap("map").getEntryView( "key" );
System.out.println ("size in memory : " + entry.getCost());
System.out.println ("creationTime : " + entry.getCreationTime());
System.out.println ("expirationTime : " + entry.getExpirationTime());
System.out.println ("number of hits : " + entry.getHits());
System.out.println ("lastAccessedTime: " + entry.getLastAccessTime());
System.out.println ("lastUpdateTime : " + entry.getLastUpdateTime());
System.out.println ("version : " + entry.getVersion());
System.out.println ("key : " + entry.getKey());
System.out.println ("value : " + entry.getValue());
Hiç yorum yok:
Yorum Gönder