Package org.apache.cassandra.utils

Examples of org.apache.cassandra.utils.LatencyTracker


                    keys[i] = String.format("%010d", startKey + rows);               
                    rows++;
                }
                multigetSliceQuery.setKeys(keys);
                QueryResult<Rows<String,String,String>> result = multigetSliceQuery.execute();
                LatencyTracker readCount = commandRunner.latencies.get(result.getHostUsed());
                readCount.addMicro(result.getExecutionTimeMicro());

                log.info("executed multiget batch of {}. {} of {} complete", new Object[]{commandArgs.batchSize, rows, commandArgs.getKeysPerThread()});
            }
        } catch (Exception e) {
            log.error("Problem: ", e);
View Full Code Here


    private Operation previousOperation;
   
    public CommandRunner(Set<CassandraHost> cassandraHosts) {
        latencies = new ConcurrentHashMap<CassandraHost, LatencyTracker>();
        for (CassandraHost host : cassandraHosts) {
            latencies.put(host, new LatencyTracker());
        }       
    }
View Full Code Here

       
       
        exec.shutdown();
       
        for (CassandraHost host : latencies.keySet()) {
            LatencyTracker latency = latencies.get(host);
            log.info("Latency for host {}:\n Op Count {} \nRecentLatencyHistogram {} \nRecent Latency Micros {} \nTotalLatencyHistogram {} \nTotalLatencyMicros {}",
                    new Object[]{host.getName(), latency.getOpCount(), latency.getRecentLatencyHistogramMicros(), latency.getRecentLatencyMicros(),
                    latency.getTotalLatencyHistogramMicros(), latency.getTotalLatencyMicros()});
        }       
    }
View Full Code Here

            while (rows < commandArgs.getKeysPerThread()) {
                rows+=commandArgs.batchSize;
                rangeSlicesQuery.setKeys(String.format("%010d", startKey + rows), "");
                rangeSlicesQuery.setRange(null, null, false, commandArgs.columnCount);
                QueryResult<OrderedRows<String,String,String>> result = rangeSlicesQuery.execute();
                LatencyTracker readCount = commandRunner.latencies.get(result.getHostUsed());
                readCount.addMicro(result.getExecutionTimeMicro());
                rows++;

                log.info("executed batch of {}. {} of {} complete", new Object[]{commandArgs.batchSize, rows, commandArgs.getKeysPerThread()});
            }
        } catch (Exception e) {
View Full Code Here

    protected void executeMutator(Mutator mutator, int rows) {
      try {
          MutationResult mr = mutator.execute();
          // could be null here when our batch size is zero
          if ( mr.getHostUsed() != null ) {
            LatencyTracker writeCount = commandRunner.latencies.get(mr.getHostUsed());
            if ( writeCount != null )
              writeCount.addMicro(mr.getExecutionTimeMicro());
          }
          mutator.discardPendingMutations();

          log.info("executed batch of {}. {} of {} complete", new Object[]{commandArgs.batchSize, rows, commandArgs.getKeysPerThread()});
View Full Code Here

    private void executeMutator(int cols) {
      try {
          MutationResult mr = mutator.execute();
          // could be null here when our batch size is zero
          if ( mr.getHostUsed() != null ) {
            LatencyTracker writeCount = commandRunner.latencies.get(mr.getHostUsed());
            if ( writeCount != null )
              writeCount.addMicro(mr.getExecutionTimeMicro());
          }
          mutator.discardPendingMutations();

          log.info("executed batch of {}. {} of {} complete", new Object[]{commandArgs.batchSize, cols, commandArgs.getKeysPerThread()});
View Full Code Here

TOP

Related Classes of org.apache.cassandra.utils.LatencyTracker

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.