Search in sources :

Example 1 with FopStatistic

use of org.ovirt.engine.api.model.FopStatistic 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 2 with FopStatistic

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

Aggregations

FopStatistic (org.ovirt.engine.api.model.FopStatistic)2 Statistics (org.ovirt.engine.api.model.Statistics)2 BlockStatistics (org.ovirt.engine.api.model.BlockStatistics)1 FopStatistics (org.ovirt.engine.api.model.FopStatistics)1 V3FopStatistic (org.ovirt.engine.api.v3.types.V3FopStatistic)1 FopStats (org.ovirt.engine.core.common.businessentities.gluster.FopStats)1