use of org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel in project ovirt-engine by oVirt.
the class VolumeListModel method showVolumeProfiling.
private void showVolumeProfiling() {
if (getSelectedItem() == null || getWindow() != null) {
return;
}
GlusterVolumeEntity selectedVolume = getSelectedItem();
VolumeProfileStatisticsModel profileStatsModel = new VolumeProfileStatisticsModel(selectedVolume.getClusterId(), selectedVolume.getId(), selectedVolume.getName());
setWindow(profileStatsModel);
setHelpTag(HelpTag.volume_profile_statistics);
// $NON-NLS-1$
setHashName("volume_profile_statistics");
// $NON-NLS-1$
profileStatsModel.startProgress(ConstantsManager.getInstance().getConstants().fetchingDataMessage());
// $NON-NLS-1$
UICommand closeProfilingStats = new UICommand("closeProfileStats", VolumeListModel.this);
closeProfilingStats.setTitle(ConstantsManager.getInstance().getConstants().close());
closeProfilingStats.setIsCancel(true);
profileStatsModel.getCommands().add(closeProfilingStats);
if (selectedVolume.isNfsEnabled()) {
profileStatsModel.queryBackend(true);
}
profileStatsModel.queryBackend(false);
}
use of org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel in project ovirt-engine by oVirt.
the class VolumeProfileStatisticsPopupView method edit.
@Override
public void edit(final VolumeProfileStatisticsModel object) {
driver.edit(object);
volumeProfileStats.asEditor().edit(object.getCumulativeStatistics());
nfsServerProfileStats.asEditor().edit(object.getNfsServerProfileStats());
profileRunTime.setText(object.getProfileRunTime());
nfsProfileRunTime.setText(object.getNfsProfileRunTime());
bytesRead.setText(object.getBytesRead());
nfsBytesRead.setText(object.getNfsBytesRead());
bytesWritten.setText(object.getBytesWritten());
nfsBytesWritten.setText(object.getNfsBytesWritten());
ClickHandler brickTabClickHandler = event -> object.queryBackend(true);
brickRefreshIcon.setRefreshIconClickListener(brickTabClickHandler);
ClickHandler nfsTabClickHandler = event -> object.queryBackend(false);
nfsRefreshIcon.setRefreshIconClickListener(nfsTabClickHandler);
object.getPropertyChangedEvent().addListener((ev, sender, args) -> {
if (args.propertyName.equals("brickProfileRunTimeChanged")) {
// $NON-NLS-1$
profileRunTime.setText(object.getProfileRunTime());
}
if (args.propertyName.equals("brickProfileDataRead")) {
// $NON-NLS-1$
bytesRead.setText(object.getBytesRead());
}
if (args.propertyName.equals("brickProfileDataWritten")) {
// $NON-NLS-1$
bytesWritten.setText(object.getBytesWritten());
}
if (args.propertyName.equals("nfsProfileRunTimeChanged")) {
// $NON-NLS-1$
nfsProfileRunTime.setText(object.getNfsProfileRunTime());
}
if (args.propertyName.equals("nfsProfileDataRead")) {
// $NON-NLS-1$
nfsBytesRead.setText(object.getNfsBytesRead());
}
if (args.propertyName.equals("nfsProfileDataWritten")) {
// $NON-NLS-1$
nfsBytesWritten.setText(object.getNfsBytesWritten());
}
if (args.propertyName.equals("statusOfFetchingProfileStats")) {
// $NON-NLS-1$
boolean disableErrorLabels = !object.isSuccessfulProfileStatsFetch();
if (!disableErrorLabels) {
String url = object.getProfileExportUrl();
// $NON-NLS-1$
boolean isBrickTabSelected = !url.contains(";nfsStatistics=true");
initAnchor(url, isBrickTabSelected ? brickProfileAnchor : nfsProfileAnchor);
}
bricksError.setVisible(disableErrorLabels);
nfsError.setVisible(disableErrorLabels);
}
});
}
Aggregations