Skip to content

Instantly share code, notes, and snippets.

@enesakar
Created March 9, 2012 06:19
Show Gist options
  • Select an option

  • Save enesakar/2005323 to your computer and use it in GitHub Desktop.

Select an option

Save enesakar/2005323 to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws FileNotFoundException {
try {
// Config cfg = new FileSystemXmlConfig("C:\\java\\hazelcast.xml");
// Hazelcast.init(cfg);
IMap mymap = Hazelcast.getMap("mymap");
long start = System.currentTimeMillis();
while (true) {
for (int i = 0; i < 1000; i++) {
if (i % 2 == 0)
mymap.put(System.currentTimeMillis(), new Byte[100000], 10, TimeUnit.SECONDS);
else
mymap.put(System.currentTimeMillis(), new Byte[100000]);
Thread.sleep(1);
}
long current = System.currentTimeMillis();
System.out.println("Current Map Size:" + mymap.size() + " Seconds:" + (current - start) / 1000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment