Examples of JRedisChunkedPipeline


Examples of org.jredis.ri.alphazero.JRedisChunkedPipeline

  @Override
  public void run() {
    int database = 11;
    ConnectionSpec connSpec = DefaultConnectionSpec.newSpec("localhost", 6379, database, "jredis".getBytes());
    JRedisFuture jredis = new JRedisChunkedPipeline(connSpec);
   
    byte[] key = "cpct".getBytes();
    int iters = 100000;
   
    for(;;){
      Future<Long> frCounter = null;
      long start = System.nanoTime();
      for(int i=0;i<iters; i++){
        frCounter = jredis.incr(key);
      }
      long queued = System.nanoTime() - start;
      try {
        jredis.flush();
        long counter = frCounter.get()// NOTE: excellent place to put implicit flush()
        long delta_ns = System.nanoTime() - start;
        long delta_ms = TimeUnit.MILLISECONDS.convert(delta_ns, TimeUnit.NANOSECONDS);
        float opsrate = iters/delta_ms;
        Log.log("counter: %d  msec:%d ops/msecs:%f  [q-delta:%d] [delta:%d]", counter, delta_ms, opsrate, queued, delta_ns);
View Full Code Here

Examples of org.jredis.ri.alphazero.JRedisChunkedPipeline

  }
  final ConnectionSpec spec;
  final JRedisFuture jredis;
  public AdHocTestChunkPipeline() {
    spec = DefaultConnectionSpec.newSpec().setCredentials("jredis").setDatabase(11);
    jredis = new JRedisChunkedPipeline(spec);
//    jredis = new JRedisPipeline(spec);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.