use of fish.payara.monitoring.collect.MonitoringDataCollector in project Payara by payara.
the class FaultToleranceServiceImpl method collect.
@Override
@MonitoringData(ns = "ft")
public void collect(MonitoringDataCollector collector) {
for (Entry<MethodKey, FaultToleranceMethodContextImpl> methodEntry : contextByMethod.entrySet()) {
MonitoringDataCollector methodCollector = collector.group(methodEntry.getKey().getMethodId()).tag("app", methodEntry.getValue().getAppName());
FaultToleranceMethodContext context = methodEntry.getValue();
BlockingQueue<Thread> concurrentExecutions = context.getConcurrentExecutions();
if (concurrentExecutions != null) {
collectBulkheadSemaphores(methodCollector, concurrentExecutions);
collectBulkheadSemaphores(methodCollector, concurrentExecutions, context.getQueuingOrRunningPopulation());
}
collectCircuitBreakerState(methodCollector, context.getState());
}
}
use of fish.payara.monitoring.collect.MonitoringDataCollector in project Payara by payara.
the class EventBus method collect.
@Override
public void collect(MonitoringDataCollector rootCollector) {
MonitoringDataCollector eventCollector = rootCollector.in("topic");
if (hzCore.isEnabled()) {
HazelcastInstance hz = hzCore.getInstance();
for (DistributedObject obj : hz.getDistributedObjects()) {
if (TopicService.SERVICE_NAME.equals(obj.getServiceName())) {
LocalTopicStats stats = hz.getTopic(obj.getName()).getLocalTopicStats();
eventCollector.group(obj.getName()).collect("PublishedCount", stats.getPublishOperationCount()).collect("ReceiveedCount", stats.getReceiveOperationCount());
}
}
}
}
use of fish.payara.monitoring.collect.MonitoringDataCollector in project Payara by payara.
the class JVMStatsProviderBootstrap method collect.
@Override
public void collect(MonitoringDataCollector collector) {
MonitoringDataCollector jvm = collector.in("jvm");
jvm.collectObject(sRuntimeStatsProvider, MonitoringDataCollection::collectObject).collectObject(clStatsProvider, MonitoringDataCollection::collectObject).collectObject(compileStatsProvider, MonitoringDataCollection::collectObject).collectObject(memoryStatsProvider, MonitoringDataCollection::collectObject).collectObject(osStatsProvider, MonitoringDataCollection::collectObject).collectObject(runtimeStatsProvider, MonitoringDataCollection::collectObject).collectObject(threadSysStatsProvider, MonitoringDataCollection::collectObject);
for (JVMGCStatsProvider gc : jvmStatsProviderList) {
jvm.group(gc.getGcName()).collectObject(gc, MonitoringDataCollection::collectObject);
}
}
use of fish.payara.monitoring.collect.MonitoringDataCollector in project Payara by payara.
the class HealthCheckService method collectChecks.
private Map<String, List<HealthCheckResponse>> collectChecks(MonitoringDataCollector collector, Map<String, Set<HealthCheck>> checks, Map<String, Set<String>> collected) {
Map<String, List<HealthCheckResponse>> statusByApp = new HashMap<>();
for (Entry<String, Set<HealthCheck>> entry : checks.entrySet()) {
String appName = entry.getKey();
MonitoringDataCollector appCollector = collector.group(appName);
for (HealthCheck check : entry.getValue()) {
HealthCheckResponse response = performHealthCheckInApplicationContext(appName, check);
String metric = response.getName();
Set<String> appCollected = collected.get(appName);
// prevent adding same check more then once, unfortunately we have to run it to find that out
if (appCollected == null || !appCollected.contains(metric)) {
statusByApp.computeIfAbsent(appName, key -> new ArrayList<>()).add(response);
collectUpDown(appCollector, response);
if (response.getStatus() == Status.DOWN && response.getData().isPresent()) {
appCollector.annotate(metric, 0L, createAnnotation(response.getData().get()));
}
collected.computeIfAbsent(appName, key -> new HashSet<>()).add(metric);
}
}
}
return statusByApp;
}
Aggregations