Search in sources :

Example 1 with BlockStatistics

use of org.ovirt.engine.api.model.BlockStatistics in project ovirt-engine by oVirt.

the class GlusterVolumeProfileInfoMapper method mapBlockStats.

private static void mapBlockStats(ProfileDetail profileDetail, StatsInfo statsInfo) {
    for (BlockStats blockStat : statsInfo.getBlockStats()) {
        BlockStatistic bStat = new BlockStatistic();
        bStat.setStatistics(new Statistics());
        bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BLOCK_SIZE), blockStat.getSize()));
        bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BYTES_BLOCK_READ), blockStat.getBlockRead()));
        bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BYTES_BLOCK_WRITE), blockStat.getBlockWrite()));
        profileDetail.setBlockStatistics(new BlockStatistics());
        profileDetail.getBlockStatistics().getBlockStatistics().add(bStat);
    }
}
Also used : BlockStatistic(org.ovirt.engine.api.model.BlockStatistic) BlockStats(org.ovirt.engine.core.common.businessentities.gluster.BlockStats) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) Statistics(org.ovirt.engine.api.model.Statistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics)

Example 2 with BlockStatistics

use of org.ovirt.engine.api.model.BlockStatistics in project ovirt-engine by oVirt.

the class V3ProfileDetailInAdapter method adapt.

@Override
public ProfileDetail adapt(V3ProfileDetail from) {
    ProfileDetail to = new ProfileDetail();
    if (from.isSetBlockStatistic()) {
        to.setBlockStatistics(new BlockStatistics());
        to.getBlockStatistics().getBlockStatistics().addAll(adaptIn(from.getBlockStatistic()));
    }
    if (from.isSetDuration()) {
        to.setDuration(from.getDuration());
    }
    if (from.isSetFopStatistic()) {
        to.setFopStatistics(new FopStatistics());
        to.getFopStatistics().getFopStatistics().addAll(adaptIn(from.getFopStatistic()));
    }
    if (from.isSetProfileType()) {
        to.setProfileType(from.getProfileType());
    }
    if (from.isSetStatistic()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistic()));
    }
    return to;
}
Also used : V3ProfileDetail(org.ovirt.engine.api.v3.types.V3ProfileDetail) ProfileDetail(org.ovirt.engine.api.model.ProfileDetail) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) Statistics(org.ovirt.engine.api.model.Statistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics)

Aggregations

BlockStatistics (org.ovirt.engine.api.model.BlockStatistics)2 FopStatistics (org.ovirt.engine.api.model.FopStatistics)2 Statistics (org.ovirt.engine.api.model.Statistics)2 BlockStatistic (org.ovirt.engine.api.model.BlockStatistic)1 ProfileDetail (org.ovirt.engine.api.model.ProfileDetail)1 V3ProfileDetail (org.ovirt.engine.api.v3.types.V3ProfileDetail)1 BlockStats (org.ovirt.engine.core.common.businessentities.gluster.BlockStats)1