Package com.google.common.base

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


                    .build())
            .build()
            .createInjector();
       
        event.await();
        long elapsed = sw.elapsed(TimeUnit.MILLISECONDS);
        LOG.info("Elapsed: " + elapsed);
        Assert.assertTrue(initCalled.get());
        Assert.assertTrue(shutdownCalled.get());
        Assert.assertTrue(elapsed > 1000);
       
View Full Code Here


            Stopwatch s = Stopwatch.createStarted();
            try {
                input.stop();

                LOG.info("Input <{}> closed. Took [{}ms]", input.getUniqueReadableId(), s.elapsed(TimeUnit.MILLISECONDS));
            } catch (Exception e) {
                LOG.error("Unable to stop input <{}> [{}]: " + e.getMessage(), input.getUniqueReadableId(), input.getName());
            } finally {
                s.stop();
            }
View Full Code Here

            if (futures.containsKey(periodical)) {
                futures.get(periodical).cancel(false);

                s.stop();
                LOG.info("Shutdown of periodical [{}] complete, took <{}ms>.",
                        periodical.getClass().getCanonicalName(), s.elapsed(TimeUnit.MILLISECONDS));
            } else {
                LOG.error("Could not find periodical [{}] in futures list. Not stopping execution.",
                        periodical.getClass().getCanonicalName());
            }
        }
View Full Code Here

                job.execute()// ... blocks until it finishes.
                x.stop();

                jobs.remove(job.getId());

                String msg = "SystemJob <" + job.getId() + "> [" + jobClass + "] finished in " + x.elapsed(TimeUnit.MILLISECONDS) + "ms.";
                LOG.info(msg);
                activityWriter.write(new Activity(msg, SystemJobManager.class));
            }
        });
View Full Code Here

        final Stopwatch stopwatch = Stopwatch.createStarted();

        try (final InputStream reader = new URL(url).openConnection().getInputStream();
             final OutputStream writer = new FileOutputStream(jarPath(url, pluginType))) {
            long totalBytesRead = ByteStreams.copy(reader, writer);
            System.out.println("Done. " + totalBytesRead + " bytes read (took " + stopwatch.elapsed(TimeUnit.SECONDS) + "s).");
        }
    }
   
    public static boolean compatible(Set<String> versions) {
        if (versions == null) {
View Full Code Here

            }
            final IErlElement parent = (IErlElement) element;
            final boolean result = parent.hasChildrenOfKind(ErlElementKind.EXTERNAL_ROOT,
                    ErlElementKind.EXTERNAL_APP, ErlElementKind.EXTERNAL_FOLDER,
                    ErlElementKind.MODULE);
            if (clock.elapsed(TimeUnit.MILLISECONDS) > 100) {
                ErlLogger.debug("TIME open " + element.getClass() + " " + element + "  "
                        + clock.elapsed(TimeUnit.MILLISECONDS) + " ms");
            }
            return result;
        }
View Full Code Here

            final boolean result = parent.hasChildrenOfKind(ErlElementKind.EXTERNAL_ROOT,
                    ErlElementKind.EXTERNAL_APP, ErlElementKind.EXTERNAL_FOLDER,
                    ErlElementKind.MODULE);
            if (clock.elapsed(TimeUnit.MILLISECONDS) > 100) {
                ErlLogger.debug("TIME open " + element.getClass() + " " + element + "  "
                        + clock.elapsed(TimeUnit.MILLISECONDS) + " ms");
            }
            return result;
        }
        return false;
    }
View Full Code Here

                    final OtpErlangAtom isModuleA = (OtpErlangAtom) t.elementAt(2);
                    result.add(new ExternalTreeEntry(parentPath, path, isModuleA
                            .atomValue().equals("module")));
                }
                final String msg = "open:external_module_tree <- " + stopwatch;
                if (stopwatch.elapsed(TimeUnit.SECONDS) > 5) {
                    ErlLogger.warn("WARNING " + msg);
                } else {
                    if (ModelConfig.verbose) {
                        ErlLogger.debug(msg);
                    }
View Full Code Here

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

      logger.debug(">> awaiting post-installation actions on vm: %s", masterName);
      ListenableFuture<ExecResponse> execCleanup = machineUtils.runScriptOnNode(nodeMetadata,
               call("cleanupUdevIfNeeded"), RunScriptOptions.NONE);
View Full Code Here

                System.out.println("Committing: " + diff);
            }
            mk.commit("/", diff, null, null);
            watch.stop();
            if (debug) {
                System.out.println("Committed in " + watch.elapsed(TimeUnit.MILLISECONDS) + "ms");
            }
        }
        if (debug) {
            System.out.println("Final Result:" + watch);
        }
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.