use of org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics in project ovirt-engine by oVirt.
the class HostMonitoring method saveDataToDb.
private void saveDataToDb() {
if (saveVdsDynamic) {
vdsManager.updateDynamicData(vds.getDynamicData());
if (refreshedCapabilities) {
vdsManager.updateNumaData(vds);
}
}
if (saveVdsStatistics) {
VdsStatistics stat = vds.getStatisticsData();
vdsManager.updateStatisticsData(stat);
checkVdsMemoryThreshold(stat);
checkVdsCpuThreshold(stat);
checkVdsNetworkThreshold(stat);
checkVdsSwapThreshold(stat);
final List<VdsNetworkStatistics> statistics = new LinkedList<>();
for (VdsNetworkInterface iface : vds.getInterfaces()) {
statistics.add(iface.getStatistics());
}
if (!statistics.isEmpty()) {
TransactionSupport.executeInScope(TransactionScopeOption.Required, () -> {
getDbFacade().getInterfaceDao().massUpdateStatisticsForVds(statistics);
return null;
});
}
saveNumaStatisticsDataToDb();
}
}
Aggregations