Package com.google.common.base

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


                                // Don't retry if exception is too severe.
                                if (!_pool.isRetriableException(e)) {
                                    throw e;
                                }
                            }
                        } while (retry.allowRetry(++numAttempts, sw.elapsedMillis()));

                        throw new MaxRetriesException();
                    } finally {
                        timer.stop();
                    }
View Full Code Here


        int i = 0;
        while (true) {
            i += 1;

            if (i % checkInterval == 0) {
                if (watch.elapsedMillis() > milliseconds) {
                    return;
                }
            }
        }
    }
View Full Code Here

        System.out.println("==SEQUENTIAL==");
        watch = new Stopwatch().start();
        engine.doAnalysisSequential();
        watch.stop();
        System.out.println(watch.elapsedMillis() + "ms taken.");

        System.out.println("==PARALLEL==");
        watch = new Stopwatch().start();
        engine.doAnalysisParallel();
        watch.stop();
View Full Code Here

        System.out.println("==PARALLEL==");
        watch = new Stopwatch().start();
        engine.doAnalysisParallel();
        watch.stop();
        System.out.println(watch.elapsedMillis() + "ms taken.");
    }
}
View Full Code Here

            i += 1;
            i = i % timeoutCount;

            Thread.sleep(timeout);

            if (watch.elapsedMillis() > milliseconds) {
                return;
            }

        }
View Full Code Here

        System.out.println("==SEQUENTIAL==");
        watch = new Stopwatch().start();
        engine.doAnalysisSequential();
        watch.stop();
        System.out.println(watch.elapsedMillis() + "ms taken.");

        System.out.println("==PARALLEL==");
        watch = new Stopwatch().start();
        engine.doAnalysisParallel();
        watch.stop();
View Full Code Here

        System.out.println("==PARALLEL==");
        watch = new Stopwatch().start();
        engine.doAnalysisParallel();
        watch.stop();
        System.out.println(watch.elapsedMillis() + "ms taken.");
    }
}
View Full Code Here

      String originalId = node.get().getId();
      NodeMetadata originalNode = node.get();
      try {
         Stopwatch stopwatch = new Stopwatch().start();
         if (!nodeRunning.apply(node)) {
            long timeWaited = stopwatch.elapsedMillis();
            if (node.get() == null) {
               node.set(originalNode);
               throw new IllegalStateException(format("api response for node(%s) was null", originalId));
            } else {
               throw new IllegalStateException(format(
View Full Code Here

      appendToLog(TransactionEdit.createStarted(tx.getWritePointer(), tx.getVisibilityUpperBound(),
                                                expiration, nextWritePointer));
    } finally {
      this.logReadLock.unlock();
    }
    txMetricsCollector.gauge("start.short.latency", (int) timer.elapsedMillis());
    return tx;
  }

  private long getNextWritePointer() {
    // We want to align tx ids with current time. We assume that tx ids are sequential, but not less than
View Full Code Here

      appendToLog(TransactionEdit.createStarted(tx.getWritePointer(), tx.getVisibilityUpperBound(),
                                                -currentTime, nextWritePointer));
    } finally {
      this.logReadLock.unlock();
    }
    txMetricsCollector.gauge("start.long.latency", (int) timer.elapsedMillis());
    return tx;
  }

  private void addInProgressAndAdvance(long writePointer, long visibilityUpperBound,
                                       long expiration, long nextPointer) {
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.