Package com.google.common.base

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


    @Override
    public void run() {
      Stopwatch sw = new Stopwatch();
      Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes();
      while (shouldRun) {
        sw.reset().start();
        try {
          Thread.sleep(SLEEP_INTERVAL_MS);
        } catch (InterruptedException ie) {
          return;
        }
View Full Code Here


        LogOp op = geogig.command(LogOp.class);
        for (ObjectId id : ids) {
            op.addCommit(id);
        }
        sw.reset().start();
        Iterator<RevCommit> commits = op.call();
        sw.stop();
        System.err.println("LogOp took " + sw.toString());

        benchmarkIteration(commits);
View Full Code Here

        op = geogig.command(LogOp.class).setTopoOrder(true);
        for (ObjectId id : ids) {
            op.addCommit(id);
        }
        sw.reset().start();
        commits = op.call();
        sw.stop();
        System.err.println("LogOp using --topo-order took " + sw.toString());
        benchmarkIteration(commits);
View Full Code Here

        createCommits(numCommits, "");
        sw.stop();
        System.err.println(numberFormat.format(numCommits) + " created in " + sw.toString());
        System.err.flush();

        sw.reset().start();
        Iterator<RevCommit> commits = geogig.command(LogOp.class).call();
        sw.stop();
        System.err.println("LogOp took " + sw.toString());

        benchmarkIteration(commits);
View Full Code Here

    }

    private void benchmarkIteration(Iterator<RevCommit> commits) {
        NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);
        Stopwatch sw = Stopwatch.createStarted();
        sw.reset().start();
        int c = 0;
        while (commits.hasNext()) {
            c++;
            commits.next();
        }
View Full Code Here

            sw.stop();
            listener.setDescription(insertedCount + " distinct features inserted in " + sw);

            listener.setDescription("Building final tree...");

            sw.reset().start();
            newFeatureTree = builder.build();

            listener.setDescription(String.format("%d features tree built in %s",
                    newFeatureTree.size(), sw.stop()));
            listener.complete();
View Full Code Here

            throw e;
        } finally {
            nodeIndex.close();
        }
        LOGGER.debug("Index traversed in {}", sw.stop());
        sw.reset().start();

        RevTree namedTree = builder.build();
        saveExtraFeatureTypes();
        LOGGER.debug("RevTreeBuilder.build() in {}", sw.stop());
        return namedTree;
View Full Code Here

                "Previsit list built in %s for %,d ids: %s. Calculating reachable content ids...",
                sw.stop(), needsPrevisit.size(), needsPrevisit));

        deduplicator.reset();

        sw.reset().start();
        ImmutableList<ObjectId> previsitResults = reachableContentIds(needsPrevisit, deduplicator);
        LOGGER.info(String.format("reachableContentIds took %s for %,d ids", sw.stop(),
                previsitResults.size()));

        deduplicator.reset();
View Full Code Here

                previsitResults.size()));

        deduplicator.reset();

        LOGGER.info("obtaining post order iterator on range...");
        sw.reset().start();

        Iterator<RevObject> objects = PostOrderIterator.range(want, new ArrayList<ObjectId>(
                previsitResults), database, traverseCommits, deduplicator);
        long objectCount = 0;
        LOGGER.info("PostOrderIterator.range took {}", sw.stop());
View Full Code Here

        assertNotNull(nodes);
        System.err.printf("Added %,d nodes to %s index in %s. Traversing...\n", count, index
                .getClass().getSimpleName(), sw.stop());
        MemoryUsage indexCreateMem = MEMORY_MX_BEAN.getHeapMemoryUsage();

        sw.reset().start();
        int size = Iterators.size(nodes);
        System.err.printf("Traversed %,d nodes in %s\n", size, sw.stop());
        MemoryUsage indexTraversedMem = MEMORY_MX_BEAN.getHeapMemoryUsage();
        final double mbFactor = 1024 * 1024;
        System.err
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.