use of org.apache.nifi.controller.status.history.StandardGarbageCollectionStatus in project nifi by apache.
the class FlowController method getGarbageCollectionStatus.
public List<GarbageCollectionStatus> getGarbageCollectionStatus() {
final List<GarbageCollectionStatus> statuses = new ArrayList<>();
final Date now = new Date();
for (final GarbageCollectorMXBean mbean : ManagementFactory.getGarbageCollectorMXBeans()) {
final String managerName = mbean.getName();
final long count = mbean.getCollectionCount();
final long millis = mbean.getCollectionTime();
final GarbageCollectionStatus status = new StandardGarbageCollectionStatus(managerName, now, count, millis);
statuses.add(status);
}
return statuses;
}
Aggregations