Package org.jredis.test.util

Examples of org.jredis.test.util.RunningAverage


    // we'll need the ClusterSpec to get the nodes
   
    ClusterSpec clusterSpec = provider.getSpec();
    assertNotNull(clusterSpec, "cluster spec must not be null");
   
    RunningAverage avg = new RunningAverage();
    int nodeCnt = clusterSpec.getNodeSpecs().size();
    Number[] data = new Number[nodeCnt];
    int i = 0;
    for(ClusterNodeSpec n : clusterSpec.getNodeSpecs()){
      Long cnt = distribution.get(n);
      avg.onMeasure(cnt);
      data[i++] = cnt;
    }
    assertTrue(avg.getMin() > 0, "No node should have zero keys assigned to it");
    assertTrue(avg.getMax() > 0, "No node should have zero keys assigned to it");
    Log.log("Distributed %d keys in a %d node cluster:\n\t Key/node distribution -- AVG: %d - MIN: %d - MAX: %d\n", keycnt, nodeCnt, avg.get(), avg.getMin(), avg.getMax());
  }
View Full Code Here

TOP

Related Classes of org.jredis.test.util.RunningAverage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.