Search in sources :

Example 1 with BlockStats

use of org.ovirt.engine.core.common.businessentities.gluster.BlockStats 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 BlockStats

use of org.ovirt.engine.core.common.businessentities.gluster.BlockStats in project ovirt-engine by oVirt.

the class GetGlusterVolumeProfileInfoQueryTest method getBlockStats.

private List<BlockStats> getBlockStats() {
    BlockStats blockStats = new BlockStats();
    blockStats.setSize(128);
    blockStats.setBlockRead(558);
    blockStats.setBlockWrite(12345);
    return Collections.singletonList(blockStats);
}
Also used : BlockStats(org.ovirt.engine.core.common.businessentities.gluster.BlockStats)

Example 3 with BlockStats

use of org.ovirt.engine.core.common.businessentities.gluster.BlockStats in project ovirt-engine by oVirt.

the class GlusterVolumeProfileInfoReturn method getBlockStats.

private List<BlockStats> getBlockStats(Object[] blockStatsObjects) {
    List<BlockStats> blockStatsList = new ArrayList<>();
    for (Object blockStatsObj : blockStatsObjects) {
        BlockStats blockStats = new BlockStats();
        Map<String, Object> blockStatsMap = (Map<String, Object>) blockStatsObj;
        blockStats.setSize(Double.valueOf((String) blockStatsMap.get(SIZE)));
        blockStats.setBlockRead(Double.valueOf((String) blockStatsMap.get(READ)));
        blockStats.setBlockWrite(Double.valueOf((String) blockStatsMap.get(WRITE)));
        blockStatsList.add(blockStats);
    }
    return blockStatsList;
}
Also used : BlockStats(org.ovirt.engine.core.common.businessentities.gluster.BlockStats) ArrayList(java.util.ArrayList) Map(java.util.Map)

Aggregations

BlockStats (org.ovirt.engine.core.common.businessentities.gluster.BlockStats)3 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 BlockStatistic (org.ovirt.engine.api.model.BlockStatistic)1 BlockStatistics (org.ovirt.engine.api.model.BlockStatistics)1 FopStatistics (org.ovirt.engine.api.model.FopStatistics)1 Statistics (org.ovirt.engine.api.model.Statistics)1