Search in sources :

Example 1 with VolumeProfileStatisticsModel

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);
}
Also used : VolumeProfileStatisticsModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 2 with VolumeProfileStatisticsModel

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);
        }
    });
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) EntityModelCellTable(org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable) AbstractEntityModelTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn) AssetProvider(org.ovirt.engine.ui.webadmin.gin.AssetProvider) RefreshActionIcon(org.ovirt.engine.ui.common.widget.dialog.RefreshActionIcon) Inject(com.google.inject.Inject) AbstractModelBoundPopupView(org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView) GWT(com.google.gwt.core.client.GWT) ListModelListBoxEditor(org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) UiBinder(com.google.gwt.uibinder.client.UiBinder) ApplicationConstants(org.ovirt.engine.ui.webadmin.ApplicationConstants) GlusterVolumeProfileStats(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats) Label(com.google.gwt.user.client.ui.Label) Alert(org.gwtbootstrap3.client.ui.Alert) SafeHtmlUtils(com.google.gwt.safehtml.shared.SafeHtmlUtils) EventBus(com.google.gwt.event.shared.EventBus) ElementIdHandler(org.ovirt.engine.ui.common.idhandler.ElementIdHandler) UiCommonEditorDriver(org.ovirt.engine.ui.common.editor.UiCommonEditorDriver) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) VolumeProfileStatisticsPopupPresenterWidget(org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.VolumeProfileStatisticsPopupPresenterWidget) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) VolumeProfileStatisticsModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel) WithElementId(org.ovirt.engine.ui.common.idhandler.WithElementId) SimpleDialogPanel(org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel) BrickProfileDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails) FopStats(org.ovirt.engine.core.common.businessentities.gluster.FopStats) UiField(com.google.gwt.uibinder.client.UiField) ClickHandler(com.google.gwt.event.dom.client.ClickHandler)

Aggregations

VolumeProfileStatisticsModel (org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel)2 GWT (com.google.gwt.core.client.GWT)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 EventBus (com.google.gwt.event.shared.EventBus)1 SafeHtmlUtils (com.google.gwt.safehtml.shared.SafeHtmlUtils)1 UiBinder (com.google.gwt.uibinder.client.UiBinder)1 UiField (com.google.gwt.uibinder.client.UiField)1 Anchor (com.google.gwt.user.client.ui.Anchor)1 Label (com.google.gwt.user.client.ui.Label)1 Inject (com.google.inject.Inject)1 Alert (org.gwtbootstrap3.client.ui.Alert)1 BrickProfileDetails (org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails)1 FopStats (org.ovirt.engine.core.common.businessentities.gluster.FopStats)1 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)1 GlusterVolumeProfileStats (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats)1 UiCommonEditorDriver (org.ovirt.engine.ui.common.editor.UiCommonEditorDriver)1 ElementIdHandler (org.ovirt.engine.ui.common.idhandler.ElementIdHandler)1 WithElementId (org.ovirt.engine.ui.common.idhandler.WithElementId)1 AbstractModelBoundPopupView (org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView)1 RefreshActionIcon (org.ovirt.engine.ui.common.widget.dialog.RefreshActionIcon)1