Package com.google.common.base

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


     
      ImmutableSet<String> tags = ImmutableSet. of(group);
      Stopwatch watch = new Stopwatch().start();
      NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1,
            inboundPorts(22, 8080).blockOnPort(22, 300).userMetadata(userMetadata).tags(tags)));
      long createSeconds = watch.elapsed(TimeUnit.SECONDS);

      final String nodeId = node.getId();

      checkUserMetadataContains(node, userMetadata);
      checkTagsInNodeEquals(node, tags);
View Full Code Here


      watch.reset().start();

      client.runScriptOnNode(nodeId, JettyStatements.install(), nameTask("configure-jetty"));

      long configureSeconds = watch.elapsed(TimeUnit.SECONDS);

      getAnonymousLogger().info(
            format(
                  "<< configured node(%s) with %s and jetty %s in %ss",
                  nodeId,
View Full Code Here

        classLoader.injectByteCode(s.replace(oldTemplateSlashName, materializedSlashName).replace(FileUtils.separatorChar, '.'), newByteCode);
//        Files.write(subcw.toByteArray(), new File(String.format("/tmp/%d-sub-%d.class", fileNum, i)));
        i++;
      }
      t4.stop();
      logger.debug(String.format("[Compile Time] Janino: %dms, Bytecode load and parse: %dms, Class Merge: %dms, Subclass remap and load: %dms.", t1.elapsed(TimeUnit.MILLISECONDS), t2.elapsed(TimeUnit.MILLISECONDS), t3.elapsed(TimeUnit.MILLISECONDS), t4.elapsed(TimeUnit.MILLISECONDS)));
      Class<?> c = classLoader.findClass(materializedClassName);
      if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
        return (T) c.newInstance();
      } else {
        throw new ClassTransformationException("The requested class did not implement the expected interface.");
View Full Code Here

    }
    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;
  }

  private class QueryResultsListener implements UserResultsListener {
    AtomicInteger count = new AtomicInteger();
View Full Code Here

      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));
    } 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) {
View Full Code Here

      Range<Long> range = Range.closedOpen(start, end);
      blockMapBuilder = blockMapBuilder.put(range, block);
    }
    blockMap = blockMapBuilder.build();
    watch.stop();
    logger.debug("Took {} ms to build block map", watch.elapsed(TimeUnit.MILLISECONDS));
    blockMapMap.put(fileName, blockMap);
  }
  /**
   * For a given RowGroup, calculate how many bytes are available on each on drillbit endpoint
   *
 
View Full Code Here

    rowGroup.setEndpointBytes(endpointByteMap);
    rowGroup.setMaxBytes(endpointByteMap.size() > 0 ? Collections.max(endpointByteMap.values()) : 0);
    logger.debug("Row group ({},{}) max bytes {}", rowGroup.getPath(), rowGroup.getStart(), rowGroup.getMaxBytes());
    watch.stop();
    logger.debug("Took {} ms to set endpoint bytes", watch.elapsed(TimeUnit.MILLISECONDS));
  }

  private DrillbitEndpoint getDrillBitEndpoint(String hostName) {
    return endPointMap.get(hostName);
  }
View Full Code Here

    for (DrillbitEndpoint d : endpoints) {
      String hostName = d.getAddress();
      endPointMap.put(hostName, d);
    }
    watch.stop();
    logger.debug("Took {} ms to build endpoint map", watch.elapsed(TimeUnit.MILLISECONDS));
  }
}
View Full Code Here

      RecordBatchLoader batchLoader = new RecordBatchLoader(client.getAllocator());
      ParquetResultListener resultListener = new ParquetResultListener(recordsPerRowGroup, batchLoader, numberOfRowGroups, numberOfTimesRead);
      Stopwatch watch = new Stopwatch().start();
      client.runQuery(UserProtos.QueryType.LOGICAL, planText, resultListener);
      resultListener.get();
      System.out.println(String.format("Took %d ms to run query", watch.elapsed(TimeUnit.MILLISECONDS)));

    }
   
  }
View Full Code Here

      RecordBatchLoader batchLoader = new RecordBatchLoader(client.getAllocator());
      ParquetResultListener resultListener = new ParquetResultListener(recordsPerRowGroup, batchLoader, numberOfRowGroups, numberOfTimesRead);
      Stopwatch watch = new Stopwatch().start();
      client.runQuery(UserProtos.QueryType.PHYSICAL, Files.toString(FileUtils.getResourceAsFile(planName), Charsets.UTF_8), resultListener);
      resultListener.get();
      System.out.println(String.format("Took %d ms to run query", watch.elapsed(TimeUnit.MILLISECONDS)));

    }

  }
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.