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