Search in sources :

Example 1 with BrickProfileDetails

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;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) StatsInfo(org.ovirt.engine.core.common.businessentities.gluster.StatsInfo) BrickProfileDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails) ArrayList(java.util.ArrayList) Map(java.util.Map)

Example 2 with BrickProfileDetails

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);
}
Also used : BrickProfileDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails)

Example 3 with BrickProfileDetails

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"));
}
Also used : StatsInfo(org.ovirt.engine.core.common.businessentities.gluster.StatsInfo) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) BrickProfileDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails)

Aggregations

BrickProfileDetails (org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails)3 StatsInfo (org.ovirt.engine.core.common.businessentities.gluster.StatsInfo)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)1 PropertyChangedEventArgs (org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)1