Package com.google.common.base

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


    long moyParsing = 0;
    long moyToString = 0;
    String sText = "userTruc.maTable[variable.attribute == false | (toto > 18 & userTruc[*].family in [\"toto\", \"titi\"])].tableau[length(texte)].name";
    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");
View Full Code Here


      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) {
        moyToString += sw.elapsedTime(TimeUnit.MICROSECONDS);
      }
//      System.out.println(" / toString : " + sw.elapsedTime(TimeUnit.MICROSECONDS) + " ms ");
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);
      } catch (NoSuchElementException e) {
View Full Code Here

      checkTagsInNodeEquals(node, tags);

      getAnonymousLogger().info(
            format("<< available node(%s) os(%s) in %ss", node.getId(), node.getOperatingSystem(), createSeconds));

      watch.reset().start();

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

      long configureSeconds = watch.elapsedTime(TimeUnit.SECONDS);
View Full Code Here

      InvocationSuccess keyPairApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = new Stopwatch().start();
      fn.apply(keyPairApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(keyPairApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when no annotation present");
View Full Code Here

      InvocationSuccess floatingIpApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = new Stopwatch().start();
      fn.apply(floatingIpApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(floatingIpApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when annotation present");
View Full Code Here

        }
        watch.stop();

        mesh.setTimeToGenerateBlockVertices((int) watch.elapsed(TimeUnit.MILLISECONDS));

        watch.reset().start();
        generateOptimizedBuffers(chunkView, mesh);
        watch.stop();
        mesh.setTimeToGenerateOptimizedBuffers((int) watch.elapsed(TimeUnit.MILLISECONDS));
        statVertexArrayUpdateCount++;
View Full Code Here

            copyOne(catalog, original, (Class<CatalogInfo>) clazz, layer, nameSuffix, globalTime);
            if ((curr + 1) % 100 == 0) {
                sw.stop();
                System.out.printf("inserted %s so far in %s (last 100 in %s)\n", (curr + 1),
                        globalTime, sw);
                sw.reset();
                sw.start();
            }
        }

View Full Code Here

      InvocationSuccess keyPairApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = Stopwatch.createStarted();
      fn.apply(keyPairApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(keyPairApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when no annotation present");
View Full Code Here

      InvocationSuccess floatingIpApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = Stopwatch.createStarted();
      fn.apply(floatingIpApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(floatingIpApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when annotation present");
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.