Package com.google.common.base

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


        m2.getDerived().setName("titi");
      }
      sw.reset().start();
      models.add(compEngine.inspectChanges(m1, m2));
      if (i != 0) {
        moyParsing += sw.elapsedTime(TimeUnit.MICROSECONDS);
      }
//      System.out.print("Inspect Changes [" + i + "] : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " mus\n");
    }
    moyParsing /= (MAX_LOOP - 1);
    System.out.println("\n\n Moy Inspect Changes " + moyParsing + " mus ");
View Full Code Here


    Stopwatch sw = new Stopwatch();
    for (int i = 0; i < MAX_LOOP; i++) {
      sw.reset().start();
      models.add(CompareTools.deepCopy(m1));
      if (i != 0) {
        moyParsing += sw.elapsedTime(TimeUnit.MICROSECONDS);
      }
//      System.out.print("DeepCopy [" + i + "] : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " mus\n");
    }
    moyParsing /= (MAX_LOOP - 1);
    System.out.println("\n\n Moy DeepCopy " + moyParsing + " mus ");
View Full Code Here

    Stopwatch sw = new Stopwatch();
    for (int i = 0; i < MAX_LOOP; i++) {
      sw.reset().start();
      DottedExpression expr = ExpressionParser.parse(sText);
      if (i != 0) {
        moyParsing += sw.elapsedTime(TimeUnit.MICROSECONDS);
      }
//      System.out.print("Parsing [" + i + "] : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " mus");
      sw.reset().start();
      exprTs.add(expr.toString());
      if (i != 0) {
View Full Code Here

      }
//      System.out.print("Parsing [" + i + "] : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " mus");
      sw.reset().start();
      exprTs.add(expr.toString());
      if (i != 0) {
        moyToString += sw.elapsedTime(TimeUnit.MICROSECONDS);
      }
//      System.out.println(" / toString : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " ms ");
    }
    moyParsing /= (MAX_LOOP - 1);
    moyToString /= (MAX_LOOP - 1);
View Full Code Here

   protected ServiceStats trackAvailabilityOfProcessOnNode(Statement process, String processName, NodeMetadata node) {
      ServiceStats stats = new ServiceStats();
      Stopwatch watch = new Stopwatch().start();
      ExecResponse exec = client.runScriptOnNode(node.getId(), process, runAsRoot(false).wrapInInitScript(false));
      stats.backgroundProcessMilliseconds = watch.elapsedTime(TimeUnit.MILLISECONDS);
      watch.reset().start();
     
      HostAndPort socket = null;
      try {
         socket = openSocketFinder.findOpenSocketOnNode(node, 8080, 60, TimeUnit.SECONDS);
View Full Code Here

         socket = openSocketFinder.findOpenSocketOnNode(node, 8080, 60, TimeUnit.SECONDS);
      } catch (NoSuchElementException e) {
         throw new NoSuchElementException(format("%s%n%s%s", e.getMessage(), exec.getOutput(), exec.getError()));
      }

      stats.socketOpenMilliseconds = watch.elapsedTime(TimeUnit.MILLISECONDS);

      getAnonymousLogger().info(format("<< %s on node(%s)[%s] %s", processName, node.getId(), socket, stats));
      return stats;
   }
View Full Code Here

     
      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.elapsedTime(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.elapsedTime(TimeUnit.SECONDS);

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

    consumerState.setState(reader.getPosition());

    // Read from the underlying file reader
    while (polledEvents.size() < maxEvents) {
      int readCount = reader.read(eventCache, maxRead, timeoutNano, TimeUnit.NANOSECONDS, readFilter);
      long elapsedNano = stopwatch.elapsedTime(TimeUnit.NANOSECONDS);
      timeoutNano -= elapsedNano;

      if (readCount > 0) {
        int eventsClaimed = getEvents(eventCache, polledEvents, maxEvents - polledEvents.size(), fifoStateContent);
View Full Code Here

          // If end of stream file or no timeout is allowed, break the loop.
          if (eof || timeout <= 0) {
            break;
          }

          if (stopwatch.elapsedTime(unit) > timeout) {
            break;
          }

          TimeUnit.NANOSECONDS.sleep(sleepNano);
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.