Search in sources :

Example 1 with GlusterVolumeProfileStats

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

the class GlusterVolumeProfileInfoReturn method prepareNfsProfileDetails.

private List<GlusterVolumeProfileStats> prepareNfsProfileDetails(Object[] nfsServerProfileDetails) {
    List<GlusterVolumeProfileStats> nfsProfileDetails = new ArrayList<>();
    for (Object nfsObject : nfsServerProfileDetails) {
        GlusterVolumeProfileStats nfsDetails = new GlusterVolumeProfileStats();
        Map<String, Object> nfsProfile = (Map<String, Object>) nfsObject;
        nfsDetails.setIdentity((String) nfsProfile.get(NFS));
        List<StatsInfo> statsInfo = new ArrayList<>();
        statsInfo.add(getStatInfo((Map<String, Object>) nfsProfile.get(CUMULATIVE_STATS), CUMULATIVE_STATS));
        statsInfo.add(getStatInfo((Map<String, Object>) nfsProfile.get(INTERVAL_STATS), INTERVAL_STATS));
        nfsDetails.setProfileStats(statsInfo);
        nfsProfileDetails.add(nfsDetails);
    }
    return nfsProfileDetails;
}
Also used : StatsInfo(org.ovirt.engine.core.common.businessentities.gluster.StatsInfo) ArrayList(java.util.ArrayList) GlusterVolumeProfileStats(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats) Map(java.util.Map)

Example 2 with GlusterVolumeProfileStats

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

the class VolumeProfileStatisticsModel method onNfsServerSelectionChange.

private void onNfsServerSelectionChange(UIMessages messages) {
    if (getNfsServers().getSelectedItem() == null) {
        return;
    }
    int index = getProfileInfo().getNfsProfileDetails().indexOf(getNfsServers().getSelectedItem());
    if (index < 0) {
        return;
    }
    List<GlusterVolumeProfileStats> nfsProfileStats = getProfileInfo().getNfsProfileDetails();
    StatsInfo selectedNfsServerCummulativeProfile = nfsProfileStats.get(index).getProfileStats().get(0);
    StatsInfo selectedNfsServerIntervalProfile = nfsProfileStats.get(index).getProfileStats().get(1);
    populateCummulativeStatistics(selectedNfsServerCummulativeProfile.getFopStats(), getNfsServerProfileStats());
    nfsProfileRunTime = formatRunTime(messages, selectedNfsServerCummulativeProfile.getDurationFormatted(), selectedNfsServerIntervalProfile.getDurationFormatted());
    // $NON-NLS-1$
    onPropertyChanged(new PropertyChangedEventArgs("nfsProfileRunTimeChanged"));
    nfsBytesRead = formatDataRead(messages, selectedNfsServerCummulativeProfile.getTotalRead(), selectedNfsServerIntervalProfile.getTotalRead());
    // $NON-NLS-1$
    onPropertyChanged(new PropertyChangedEventArgs("nfsProfileDataRead"));
    nfsBytesWritten = formatDataWritten(messages, selectedNfsServerCummulativeProfile.getTotalWrite(), selectedNfsServerIntervalProfile.getTotalWrite());
    // $NON-NLS-1$
    onPropertyChanged(new PropertyChangedEventArgs("nfsProfileDataWritten"));
}
Also used : StatsInfo(org.ovirt.engine.core.common.businessentities.gluster.StatsInfo) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) GlusterVolumeProfileStats(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats)

Aggregations

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