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


Java DiagnosticDataPoint類代碼示例

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


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

示例1: merge

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
Statistics merge(DiagnosticDataPoint dataPoint) {
	Map<String, LivenessQuota> newStatistics = new HashMap<>(livenessQuotaByService);
	LivenessQuota oldServiceQuota = newStatistics.getOrDefault(dataPoint.service(), LivenessQuota.zero());
	newStatistics.put(dataPoint.service(), oldServiceQuota.merge(dataPoint));

	LivenessQuota newTotalQuota = totalLivenessQuota.merge(dataPoint);

	return new Statistics(newTotalQuota, newStatistics);
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:10,代碼來源:Statistics.java

示例2: updateStatistics

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
public void updateStatistics() {
	List<DiagnosticDataPoint> newDataPoints = serviceObservers.stream()
			.map(ServiceObserver::gatherDataFromService)
			.collect(toList());
	Statistics newStatistics = statistician.compute(currentStatistics, newDataPoints);
	currentStatistics = newStatistics;
	repository.store(newStatistics);
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:9,代碼來源:Monitor.java

示例3: gatherDataFromService

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
@Override
public DiagnosticDataPoint gatherDataFromService() {
	// this check should actually contact the serviceName
	boolean alive = RANDOM.nextFloat() > 0.1;
	return DiagnosticDataPoint.of(serviceName, ZonedDateTime.now(), alive);
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:7,代碼來源:BetaServiceObserver.java

示例4: aliveAsLong

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
private static long aliveAsLong(DiagnosticDataPoint dataPoint) {
	return dataPoint.alive() ? 1 : 0;
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:4,代碼來源:Statistics.java

示例5: compute

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
public Statistics compute(Statistics currentStats, Iterable<DiagnosticDataPoint> dataPoints) {
	Statistics finalStats = currentStats;
	for (DiagnosticDataPoint dataPoint : dataPoints)
		finalStats = finalStats.merge(dataPoint);
	return finalStats;
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:7,代碼來源:Statistician.java

示例6: gatherDataFromService

import monitor.observer.DiagnosticDataPoint; //導入依賴的package包/類
@Override
public DiagnosticDataPoint gatherDataFromService() {
	// this check should actually contact the serviceName
	boolean alive = RANDOM.nextFloat() > 0.25;
	return DiagnosticDataPoint.of(serviceName, ZonedDateTime.now(), alive);
}
 
開發者ID:CodeFX-org,項目名稱:demo-jpms-monitor,代碼行數:7,代碼來源:AlphaServiceObserver.java


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