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


Java PauseDetector類代碼示例

本文整理匯總了Java中org.LatencyUtils.PauseDetector的典型用法代碼示例。如果您正苦於以下問題:Java PauseDetector類的具體用法?Java PauseDetector怎麽用?Java PauseDetector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: TimeWindowLatencyHistogram

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
public TimeWindowLatencyHistogram(Clock clock, HistogramConfig histogramConfig,
                                  io.micrometer.core.instrument.histogram.pause.PauseDetector pauseDetector) {
    super(clock, histogramConfig, LatencyStats.class);

    this.pauseDetector = requireNonNull(pauseDetectorCache.computeIfAbsent(pauseDetector, detector -> {
        if (detector instanceof ClockDriftPauseDetector) {
            ClockDriftPauseDetector clockDriftPauseDetector = (ClockDriftPauseDetector) detector;
            return new SimplePauseDetector(clockDriftPauseDetector.getSleepInterval().toNanos(),
                clockDriftPauseDetector.getPauseThreshold().toNanos(), 1, false);
        } else if (detector instanceof NoPauseDetector) {
            return new NoopPauseDetector();
        }
        return new NoopPauseDetector();
    }));

    initRingBuffer();
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:18,代碼來源:TimeWindowLatencyHistogram.java

示例2: DefaultCommandLatencyCollector

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
public DefaultCommandLatencyCollector(CommandLatencyCollectorOptions options) {

        this.options = options;
        this.createLatencies = id -> {

            if (PAUSE_DETECTOR_UPDATER.get(this) == null) {
                if (PAUSE_DETECTOR_UPDATER.compareAndSet(this, null, GLOBAL_PAUSE_DETECTOR)) {
                    PAUSE_DETECTOR_UPDATER.get(this).retain();
                }
            }
            PauseDetector pauseDetector = ((DefaultPauseDetectorWrapper) PAUSE_DETECTOR_UPDATER.get(this)).getPauseDetector();

            if (options.resetLatenciesAfterEvent()) {
                return new Latencies(pauseDetector);
            }

            return new CummulativeLatencies(pauseDetector);
        };
    }
 
開發者ID:lettuce-io,項目名稱:lettuce-core,代碼行數:20,代碼來源:DefaultCommandLatencyCollector.java

示例3: getPauseDetector

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
/**
 * Creates or initializes a {@link PauseDetector} instance.
 *
 * @return
 */
PauseDetector getPauseDetector() {

    while (pauseDetector == null) {

        try {
            Thread.sleep(1);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return pauseDetector;
        }
    }

    return pauseDetector;
}
 
開發者ID:lettuce-io,項目名稱:lettuce-core,代碼行數:20,代碼來源:DefaultCommandLatencyCollector.java

示例4: acquirePauseDetector

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
private static PauseDetector acquirePauseDetector() {
    synchronized (PAUSE_DETECTOR_LOCK) {
        if (pauseDetectorCount++ == 0) {
            staticPauseDetector = new SimplePauseDetector(
                TimeUnit.MILLISECONDS.toNanos(10),
                TimeUnit.MILLISECONDS.toNanos(10),
                3
            );
        }
        return staticPauseDetector;
    }
}
 
開發者ID:couchbase,項目名稱:couchbase-jvm-core,代碼行數:13,代碼來源:AbstractLatencyMetricsCollector.java

示例5: Latencies

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
Latencies(PauseDetector pauseDetector) {
    firstResponse = LatencyStats.Builder.create().pauseDetector(pauseDetector).build();
    completion = LatencyStats.Builder.create().pauseDetector(pauseDetector).build();
}
 
開發者ID:lettuce-io,項目名稱:lettuce-core,代碼行數:5,代碼來源:DefaultCommandLatencyCollector.java

示例6: CummulativeLatencies

import org.LatencyUtils.PauseDetector; //導入依賴的package包/類
CummulativeLatencies(PauseDetector pauseDetector) {
    super(pauseDetector);

    firstResponse = super.firstResponse.getIntervalHistogram();
    completion = super.completion.getIntervalHistogram();
}
 
開發者ID:lettuce-io,項目名稱:lettuce-core,代碼行數:7,代碼來源:DefaultCommandLatencyCollector.java


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