Search in sources :

Example 1 with BrokerMonitorFigure

use of com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerMonitorFigure in project cubrid-manager by CUBRID.

the class BrokerMonitorPart method refreshVisuals.

/**
	 * Refreshes this EditPart's <i>visuals</i>. This method is called by
	 * {@link #refresh()}, and may also be called in response to notifications
	 * from the model.
	 */
protected void refreshVisuals() {
    BrokerMonitorFigure figure = (BrokerMonitorFigure) this.getFigure();
    BrokerNode broker = (BrokerNode) this.getModel();
    setMode2View(figure, broker);
    BrokerDiagData dsr = broker.getBrokerDiagData();
    if (dsr == null) {
        figure.setSessionCount(0);
        figure.setActiveSessionCount(0);
        figure.setActiveSessionCount(0);
        figure.setTps(0);
    } else {
        figure.setSessionCount(Integer.parseInt(dsr.getCas_mon_session()));
        //Avoid looks like ActiveSessionCount larger then SessionCount
        figure.setActiveSessionCount(Integer.parseInt(dsr.getCas_mon_session()));
        figure.setActiveSessionCount(Integer.parseInt(dsr.getCas_mon_active()));
        figure.setTps(Integer.parseInt(dsr.getCas_mon_tran()));
    }
    super.refreshVisuals();
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerMonitorFigure) BrokerDiagData(com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagData)

Example 2 with BrokerMonitorFigure

use of com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerMonitorFigure in project cubrid-manager by CUBRID.

the class BrokerMonitorPart method createFigure.

/**
	 * get a database monitor figure.
	 * 
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 * @return a database figure
	 */
protected IFigure createFigure() {
    BrokerMonitorFigure figure = new BrokerMonitorFigure();
    BrokerNode broker = (BrokerNode) getModel();
    setMode2View(figure, broker);
    HostNode hostNode = broker.getParent();
    figure.setHint(new StringBuffer(" ").append(broker.getBrokerName()).append("@").append(hostNode.getIp()).append(":").append(hostNode.getPort()).append(" ").toString());
    return figure;
}
Also used : BrokerNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode) BrokerMonitorFigure(com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerMonitorFigure) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)

Aggregations

BrokerMonitorFigure (com.cubrid.cubridmanager.ui.mondashboard.editor.figure.BrokerMonitorFigure)2 BrokerNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.BrokerNode)2 BrokerDiagData (com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagData)1 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)1