Search in sources :

Example 21 with Statistics

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

the class V3FopStatisticInAdapter method adapt.

public FopStatistic adapt(V3FopStatistic from) {
    FopStatistic to = new FopStatistic();
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetStatistic()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistic()));
    }
    return to;
}
Also used : V3FopStatistic(org.ovirt.engine.api.v3.types.V3FopStatistic) FopStatistic(org.ovirt.engine.api.model.FopStatistic) Statistics(org.ovirt.engine.api.model.Statistics)

Example 22 with Statistics

use of org.ovirt.engine.api.model.Statistics 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)

Example 23 with Statistics

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

the class GlusterVolumeProfileInfoMapper method mapFopStats.

private static void mapFopStats(ProfileDetail profileDetail, StatsInfo statsInfo) {
    for (FopStats fopStat : statsInfo.getFopStats()) {
        FopStatistic fStat = new FopStatistic();
        fStat.setName(fopStat.getName());
        fStat.setStatistics(new Statistics());
        fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(MIN_LATENCY), fopStat.getMinLatency()));
        fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(MAX_LATENCY), fopStat.getMaxLatency()));
        fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(AVG_LATENCY), fopStat.getAvgLatency()));
        fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(HITS), fopStat.getHits()));
        profileDetail.setFopStatistics(new FopStatistics());
        profileDetail.getFopStatistics().getFopStatistics().add(fStat);
    }
}
Also used : FopStats(org.ovirt.engine.core.common.businessentities.gluster.FopStats) FopStatistic(org.ovirt.engine.api.model.FopStatistic) BlockStatistics(org.ovirt.engine.api.model.BlockStatistics) Statistics(org.ovirt.engine.api.model.Statistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics) FopStatistics(org.ovirt.engine.api.model.FopStatistics)

Example 24 with Statistics

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

the class BackendNicHelper method addStatistics.

public static void addStatistics(Nic model, VmNetworkInterface entity) {
    model.setStatistics(new Statistics());
    NicStatisticalQuery query = new NicStatisticalQuery(model);
    List<Statistic> statistics = query.getStatistics(entity);
    for (Statistic statistic : statistics) {
        LinkHelper.addLinks(statistic, query.getParentType());
    }
    model.getStatistics().getStatistics().addAll(statistics);
}
Also used : Statistic(org.ovirt.engine.api.model.Statistic) Statistics(org.ovirt.engine.api.model.Statistics)

Aggregations

Statistics (org.ovirt.engine.api.model.Statistics)24 Statistic (org.ovirt.engine.api.model.Statistic)6 BlockStatistics (org.ovirt.engine.api.model.BlockStatistics)4 FopStatistics (org.ovirt.engine.api.model.FopStatistics)4 Vms (org.ovirt.engine.api.model.Vms)3 BlockStatistic (org.ovirt.engine.api.model.BlockStatistic)2 FopStatistic (org.ovirt.engine.api.model.FopStatistic)2 KatelloErrata (org.ovirt.engine.api.model.KatelloErrata)2 ProfileDetail (org.ovirt.engine.api.model.ProfileDetail)2 ReportedDevices (org.ovirt.engine.api.model.ReportedDevices)2 StorageDomains (org.ovirt.engine.api.model.StorageDomains)2 V3Disk (org.ovirt.engine.api.v3.types.V3Disk)2 Test (org.junit.Test)1 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)1 Cdroms (org.ovirt.engine.api.model.Cdroms)1 CustomProperties (org.ovirt.engine.api.model.CustomProperties)1 Disk (org.ovirt.engine.api.model.Disk)1 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)1 DiskAttachments (org.ovirt.engine.api.model.DiskAttachments)1