Search in sources :

Example 6 with VdsNetworkStatistics

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();
    }
}
Also used : VdsNetworkStatistics(org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) VdsStatistics(org.ovirt.engine.core.common.businessentities.VdsStatistics) LinkedList(java.util.LinkedList)

Aggregations

VdsNetworkStatistics (org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics)6 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)4 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)1 Test (org.junit.Test)1 VdsStatistics (org.ovirt.engine.core.common.businessentities.VdsStatistics)1 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)1 InterfaceStatus (org.ovirt.engine.core.common.businessentities.network.InterfaceStatus)1