当前位置: 首页>>代码示例>>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;未经允许,请勿转载。