當前位置: 首頁>>代碼示例>>Java>>正文


Java Clock.getTick方法代碼示例

本文整理匯總了Java中com.codahale.metrics.Clock.getTick方法的典型用法代碼示例。如果您正苦於以下問題:Java Clock.getTick方法的具體用法?Java Clock.getTick怎麽用?Java Clock.getTick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.codahale.metrics.Clock的用法示例。


在下文中一共展示了Clock.getTick方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CustomMeter

import com.codahale.metrics.Clock; //導入方法依賴的package包/類
public CustomMeter(final Clock clock, final int periodSec) {
	final double ps = periodSec > 0 ? periodSec : 10;
	final int intervalSecs = 1;
	rateAvg = new EWMA(1 - exp(-intervalSecs / ps), intervalSecs, TimeUnit.SECONDS);
	this.clock = clock;
	startTime = clock.getTick();
	lastTick.set(startTime);
}
 
開發者ID:emc-mongoose,項目名稱:mongoose-base,代碼行數:9,代碼來源:CustomMeter.java

示例2: ExponentialLeakyBucket

import com.codahale.metrics.Clock; //導入方法依賴的package包/類
/**
 * Creates a new {@link ExponentialLeakyBucket}.
 *
 * @param size  the number of samples to keep in the sampling reservoir
 * @param alpha the exponential decay factor; the higher this is, the more biased the reservoir
 *              will be towards newer values
 * @param clock the clock to use
 */
public ExponentialLeakyBucket(int size, double alpha, Clock clock) {
    this.values = new ConcurrentSkipListMap<Double, T>();
    this.lock = new ReentrantReadWriteLock();
    this.alpha = alpha;
    this.size = size;
    this.clock = clock;
    this.count = new AtomicLong(0);
    this.startTime = currentTimeInSeconds();
    this.nextScaleTime = new AtomicLong(clock.getTick() + RESCALE_THRESHOLD);
}
 
開發者ID:jenkinsci,項目名稱:metrics-plugin,代碼行數:19,代碼來源:ExponentialLeakyBucket.java

示例3: OperationContext

import com.codahale.metrics.Clock; //導入方法依賴的package包/類
public OperationContext(OperationId id, Clock clock) {
  this.id = id;
  this.startTime = clock.getTick();
}
 
開發者ID:ApptuitAI,項目名稱:JInsight,代碼行數:5,代碼來源:RuleHelper.java


注:本文中的com.codahale.metrics.Clock.getTick方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。