Package com.google.common.base

Examples of com.google.common.base.Stopwatch.start()


      masterMachine.setExtraData(GUEST_OS_PASSWORD, masterSpec.getLoginCredentials().getPassword());

      SshClient client = sshClientForIMachine.apply(masterMachine);
      logger.debug(">> awaiting installation to finish node(%s)", masterName);
      Stopwatch stopwatch = new Stopwatch();
      stopwatch.start();
      checkState(sshResponds.apply(client), "timed out waiting for guest %s to be accessible via ssh", masterName);
      stopwatch.stop();
      logger.debug(String.format("Elapsed time for the OS installation: %d minutes", TimeUnit.SECONDS.convert(stopwatch.elapsed(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS)));
      NodeMetadata nodeMetadata = imachineToNodeMetadata.apply(masterMachine);
View Full Code Here


    @Ignore("OAK-461")
    public void commitTime() throws Exception {
        boolean debug = false;
        final Stopwatch watch = new Stopwatch();
        for (int i = 0; i < 1000; i++) {
            watch.start();
            String diff = "+\"a"+i+"\" : {} +\"b"+i+"\" : {} +\"c"+i+"\" : {}";
            if (debug) {
                System.out.println("Committing: " + diff);
            }
            mk.commit("/", diff, null, null);
View Full Code Here

        checkState(servicesByState.put(to, service),
            "Service %s in the state map unexpectedly at %s", service, to);
        // Update the timer
        Stopwatch stopwatch = startupTimers.get(service);
        if (from == NEW) {
          stopwatch.start();
        }
        if (to.compareTo(RUNNING) >= 0 && stopwatch.isRunning()) {
          // N.B. if we miss the STARTING event then we will never record a startup time.
          stopwatch.stop();
          if (!(service instanceof NoOpService)) {
View Full Code Here

    final int printInterval = 100000;
    Random rd = new Random(id);
    boolean get = c.getBoolean("hbase.test.do.gets", false);
    try {
      Stopwatch stopWatch = new Stopwatch();
      stopWatch.start();
      for (int i = 0; i < namespaceSpan; i++) {
        byte [] b = format(rd.nextLong());
        if (get){
          Get g = new Get(b);
          table.get(g);
View Full Code Here

          table.put(p);
        }
        if (i % printInterval == 0) {
          LOG.info("Put " + printInterval + "/" + stopWatch.elapsedMillis());
          stopWatch.reset();
          stopWatch.start();
        }
      }
      LOG.info("Finished a cycle putting " + namespaceSpan + " in " +
          (System.currentTimeMillis() - startTime) + "ms");
    } finally {
View Full Code Here

      final long timeoutMs = 1000;

      OpenSocketFinder finder = new ConcurrentOpenSocketFinder(socketAlwaysClosed, nodeRunning, userExecutor);

      Stopwatch stopwatch = new Stopwatch();
      stopwatch.start();
      try {
         finder.findOpenSocketOnNode(node, 22, timeoutMs, MILLISECONDS);
         fail();
      } catch (NoSuchElementException success) {
         // expected
View Full Code Here

      default:
        System.out.println("Invalid query type: " + type);
        return -1;
    }
    Stopwatch watch = new Stopwatch();
    watch.start();
    client.runQuery(queryType, plan, listener);
    int rows = listener.await();
    System.out.println(String.format("Got %d record%s in %f seconds", rows, rows > 1 ? "s" : "", (float)watch.elapsed(TimeUnit.MILLISECONDS) / (float)1000));
    return 0;
  }
View Full Code Here

  private void buildBlockMap(String fileName) {
    Stopwatch watch = new Stopwatch();
    BlockLocation[] blocks;
    ImmutableRangeMap<Long,BlockLocation> blockMap;
    try {
      watch.start();
      FileStatus file = fs.getFileStatus(new Path(fileName));
      blocks = fs.getFileBlockLocations(file, 0 , file.getLen());
      watch.stop();
      logger.debug("Block locations: {}", blocks);
      logger.debug("Took {} ms to get Block locations", watch.elapsed(TimeUnit.MILLISECONDS));
View Full Code Here

      watch.stop();
      logger.debug("Block locations: {}", blocks);
      logger.debug("Took {} ms to get Block locations", watch.elapsed(TimeUnit.MILLISECONDS));
    } catch (IOException ioe) { throw new RuntimeException(ioe); }
    watch.reset();
    watch.start();
    ImmutableRangeMap.Builder<Long, BlockLocation> blockMapBuilder = new ImmutableRangeMap.Builder<Long,BlockLocation>();
    for (BlockLocation block : blocks) {
      long start = block.getOffset();
      long end = start + block.getLength();
      Range<Long> range = Range.closedOpen(start, end);
View Full Code Here

   *
   * @param rowGroup the RowGroup to calculate endpoint bytes for
   */
  public void setEndpointBytes(ParquetGroupScan.RowGroupInfo rowGroup) {
    Stopwatch watch = new Stopwatch();
    watch.start();
    String fileName = rowGroup.getPath();
    if (!blockMapMap.containsKey(fileName)) {
      buildBlockMap(fileName);
    }

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.