Search in sources :

Example 1 with ProfileDetail

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

the class GlusterVolumeProfileInfoMapper method mapProfileDetails.

private static void mapProfileDetails(List<StatsInfo> statsInfoList, EntityProfileDetail entityprofileDetail) {
    for (StatsInfo statsInfo : statsInfoList) {
        ProfileDetail profileDetail = new ProfileDetail();
        profileDetail.setProfileType(statsInfo.getProfileStatsType().name());
        profileDetail.setDuration(statsInfo.getDuration());
        profileDetail.setStatistics(new Statistics());
        profileDetail.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(TOTAL_READ), statsInfo.getTotalRead()));
        profileDetail.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(TOTAL_WRITE), statsInfo.getTotalWrite()));
        mapBlockStats(profileDetail, statsInfo);
        mapFopStats(profileDetail, statsInfo);
        entityprofileDetail.setProfileDetails(new ProfileDetails());
        entityprofileDetail.getProfileDetails().getProfileDetails().add(profileDetail);
    }
}
Also used : StatsInfo(org.ovirt.engine.core.common.businessentities.gluster.StatsInfo) BrickProfileDetail(org.ovirt.engine.api.model.BrickProfileDetail) NfsProfileDetail(org.ovirt.engine.api.model.NfsProfileDetail) ProfileDetail(org.ovirt.engine.api.model.ProfileDetail) EntityProfileDetail(org.ovirt.engine.api.model.EntityProfileDetail) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) Statistics(org.ovirt.engine.api.model.Statistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics) BrickProfileDetails(org.ovirt.engine.api.model.BrickProfileDetails) GlusterVolumeProfileDetails(org.ovirt.engine.api.model.GlusterVolumeProfileDetails) NfsProfileDetails(org.ovirt.engine.api.model.NfsProfileDetails) ProfileDetails(org.ovirt.engine.api.model.ProfileDetails)

Example 2 with ProfileDetail

use of org.ovirt.engine.api.model.ProfileDetail 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 ProfileDetail (org.ovirt.engine.api.model.ProfileDetail)2 Statistics (org.ovirt.engine.api.model.Statistics)2 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)1 EntityProfileDetail (org.ovirt.engine.api.model.EntityProfileDetail)1 GlusterVolumeProfileDetails (org.ovirt.engine.api.model.GlusterVolumeProfileDetails)1 NfsProfileDetail (org.ovirt.engine.api.model.NfsProfileDetail)1 NfsProfileDetails (org.ovirt.engine.api.model.NfsProfileDetails)1 ProfileDetails (org.ovirt.engine.api.model.ProfileDetails)1 V3ProfileDetail (org.ovirt.engine.api.v3.types.V3ProfileDetail)1 StatsInfo (org.ovirt.engine.core.common.businessentities.gluster.StatsInfo)1