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);
}
}
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;
}
Aggregations