use of org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails in project ovirt-engine by oVirt.
the class GlusterVolumeProfileInfoReturn method prepareBrickProfileDetails.
private List<BrickProfileDetails> prepareBrickProfileDetails(GlusterVolumeEntity volume, Object[] brickProfileDetails) {
List<BrickProfileDetails> brickProfileDetailsList = new ArrayList<>();
for (Object brickProfileObj : brickProfileDetails) {
BrickProfileDetails brickProfileDetail = new BrickProfileDetails();
Map<String, Object> brickProfile = (Map<String, Object>) brickProfileObj;
GlusterBrickEntity brick = GlusterCoreUtil.getBrickByQualifiedName(volume.getBricks(), (String) brickProfile.get(BRICK));
if (brick != null) {
brickProfileDetail.setBrickId(brick.getId());
}
List<StatsInfo> statsInfo = new ArrayList<>();
statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(CUMULATIVE_STATS), CUMULATIVE_STATS));
statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(INTERVAL_STATS), INTERVAL_STATS));
brickProfileDetail.setProfileStats(statsInfo);
brickProfileDetailsList.add(brickProfileDetail);
}
return brickProfileDetailsList;
}
use of org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails in project ovirt-engine by oVirt.
the class GetGlusterVolumeProfileInfoQueryTest method getBrickProfileDetails.
private List<BrickProfileDetails> getBrickProfileDetails() {
BrickProfileDetails profileDetails = new BrickProfileDetails();
profileDetails.setBrickId(Guid.newGuid());
profileDetails.setProfileStats(getStatsInfo());
return Collections.singletonList(profileDetails);
}
use of org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails in project ovirt-engine by oVirt.
the class VolumeProfileStatisticsModel method onBrickSelectionChange.
private void onBrickSelectionChange(UIMessages messages) {
if (getBricks().getSelectedItem() == null) {
return;
}
int index = getProfileInfo().getBrickProfileDetails().indexOf(getBricks().getSelectedItem());
if (index < 0) {
return;
}
List<BrickProfileDetails> profileStats = getProfileInfo().getBrickProfileDetails();
StatsInfo selectedBrickProfileCummulativeStats = profileStats.get(index).getProfileStats().get(0);
StatsInfo selectedBrickProfileIntervalStats = profileStats.get(index).getProfileStats().get(1);
populateCummulativeStatistics(selectedBrickProfileCummulativeStats.getFopStats(), getCumulativeStatistics());
profileRunTime = formatRunTime(messages, selectedBrickProfileCummulativeStats.getDurationFormatted(), selectedBrickProfileIntervalStats.getDurationFormatted());
// $NON-NLS-1$
onPropertyChanged(new PropertyChangedEventArgs("brickProfileRunTimeChanged"));
bytesRead = formatDataRead(messages, selectedBrickProfileCummulativeStats.getTotalRead(), selectedBrickProfileIntervalStats.getTotalRead());
// $NON-NLS-1$
onPropertyChanged(new PropertyChangedEventArgs("brickProfileDataRead"));
bytesWritten = formatDataWritten(messages, selectedBrickProfileCummulativeStats.getTotalWrite(), selectedBrickProfileIntervalStats.getTotalWrite());
// $NON-NLS-1$
onPropertyChanged(new PropertyChangedEventArgs("brickProfileDataWritten"));
}
Aggregations