Search in sources :

Example 1 with TargetConfigInfo

use of com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo in project cubrid-manager by CUBRID.

the class AddAndDelStatusTemplateTaskTest method testExec2.

public void testExec2() {
    StatusTemplateInfo info = new StatusTemplateInfo();
    info.setDb_name(testDbName);
    info.setDesc("testStatus");
    info.setName("newStatus");
    TargetConfigInfo targetConfigInfo = new TargetConfigInfo();
    targetConfigInfo.setCas_st_long_tran(new String[] { "aaa", "dd", "dd" });
    info.addTarget_config(targetConfigInfo);
    info.setSampling_term("1");
    AddStatusTemplateTask task = new AddStatusTemplateTask(serverInfo);
    task.setStatusTemplateInfo(info);
    task.buildMsg();
    task.execute();
    assertNull(task.getErrorMsg());
    StatusTemplateInfos bean = new StatusTemplateInfos();
    final CommonQueryTask<StatusTemplateInfos> showTask = new CommonQueryTask<StatusTemplateInfos>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), bean);
    showTask.execute();
    bean.getStatusTemplateInfoList();
    assertEquals(bean.getTaskName(), "getstatustemplate");
    DelStatusTemplateTask delTsk = new DelStatusTemplateTask(serverInfo);
    delTsk.setTemplateName("newStatus");
    delTsk.execute();
    assertNull(delTsk.getErrorMsg());
}
Also used : StatusTemplateInfo(com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfo) CommonQueryTask(com.cubrid.cubridmanager.core.common.task.CommonQueryTask) StatusTemplateInfos(com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos) TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Example 2 with TargetConfigInfo

use of com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo in project cubrid-manager by CUBRID.

the class AddStatusTemplateTask method buildMsg.

/**
	 * Builds a message which includes the items exclusive of task,token and
	 * dbname
	 * 
	 * @param list
	 * @return
	 */
public void buildMsg() {
    StringBuffer msg = new StringBuffer();
    msg.append("name:" + statusTemplateInfo.getName());
    msg.append("\n");
    msg.append("desc:" + statusTemplateInfo.getDesc());
    msg.append("\n");
    msg.append("db_name:" + statusTemplateInfo.getDb_name());
    msg.append("\n");
    msg.append("sampling_term:" + statusTemplateInfo.getSampling_term());
    msg.append("\n");
    msg.append("open:target_config\n");
    for (TargetConfigInfo targetConfigInfo : statusTemplateInfo.getTargetConfigInfoList()) {
        for (String[] strings : targetConfigInfo.getList()) {
            if (null != strings) {
                msg.append(strings[0] + ":");
                msg.append(strings[1] + " " + strings[2]);
                msg.append("\n");
            }
        }
    }
    msg.append("close:target_config\n");
    this.setAppendSendMsg(msg.toString());
}
Also used : TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Example 3 with TargetConfigInfo

use of com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo in project cubrid-manager by CUBRID.

the class UpdateStatusTemplateTask method buildMsg.

/**
	 * Builds a message which includes the items exclusive of task,token and
	 * dbname
	 * 
	 * @param list
	 * @return
	 */
public void buildMsg() {
    StringBuffer msg = new StringBuffer();
    msg.append("name:" + statusTemplateInfo.getName());
    msg.append("\n");
    msg.append("desc:" + statusTemplateInfo.getDesc());
    msg.append("\n");
    msg.append("db_name:" + statusTemplateInfo.getDb_name());
    msg.append("\n");
    msg.append("sampling_term:" + statusTemplateInfo.getSampling_term());
    msg.append("\n");
    msg.append("open:target_config\n");
    for (TargetConfigInfo targetConfigInfo : statusTemplateInfo.getTargetConfigInfoList()) {
        for (String[] strings : targetConfigInfo.getList()) {
            if (null != strings) {
                msg.append(strings[0] + ":");
                msg.append(strings[1] + " " + strings[2]);
                msg.append("\n");
            }
        }
    }
    msg.append("close:target_config\n");
    this.setAppendSendMsg(msg.toString());
}
Also used : TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Example 4 with TargetConfigInfo

use of com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo in project cubrid-manager by CUBRID.

the class DiagStatusMonitorTemplateDialog method okPressed.

/**
	 * Executes the task when "ok" button is pressed
	 */
@Override
public void okPressed() {
    String name = nameText.getText().trim();
    statusTemplateInfo.setName(name);
    String desc = discriptionText.getText().trim();
    statusTemplateInfo.setDesc(desc);
    String samplingTerm = samplingTermscombo.getText().trim();
    statusTemplateInfo.setSampling_term(samplingTerm);
    String dbName = "";
    if (targetDbNameCombo != null && targetDbNameCombo.getEnabled()) {
        dbName = targetDbNameCombo.getText();
    }
    statusTemplateInfo.setDb_name(dbName);
    TargetConfigInfo targetConfigInfo = new TargetConfigInfo();
    TableItem[] tableItems = tagetTbl.getItems();
    for (TableItem item : tableItems) {
        assert (null != item);
        String[] values = new String[] { "1", "1" };
        TargetConfigMap tcm = TargetConfigMap.getInstance();
        if (item.getText(1).equals(tcm.getShowOpenedPage())) {
            targetConfigInfo.setServer_query_opened_page(values);
        } else if (item.getText(1).equals(tcm.getShowSlowQuery())) {
            targetConfigInfo.setServer_query_slow_query(values);
        } else if (item.getText(1).equals(tcm.getShowFullScan())) {
            targetConfigInfo.setServer_query_full_scan(values);
        } else if (item.getText(1).equals(tcm.getShowCliRequest())) {
            targetConfigInfo.setServer_conn_cli_request(values);
        } else if (item.getText(1).equals(tcm.getShowAboutedClients())) {
            targetConfigInfo.setServer_conn_aborted_clients(values);
        } else if (item.getText(1).equals(tcm.getShowConnReq())) {
            targetConfigInfo.setServer_conn_conn_req(values);
        } else if (item.getText(1).equals(tcm.getShowConnRej())) {
            targetConfigInfo.setServer_conn_conn_reject(values);
        } else if (item.getText(1).equals(tcm.getShowPageWrite())) {
            targetConfigInfo.setServer_buffer_page_write(values);
        } else if (item.getText(1).equals(tcm.getShowPageRead())) {
            targetConfigInfo.setServer_buffer_page_read(values);
        } else if (item.getText(1).equals(tcm.getShowLockDeadlock())) {
            targetConfigInfo.setServer_lock_deadlock(values);
        } else if (item.getText(1).equals(tcm.getShowLockRequest())) {
            targetConfigInfo.setServer_lock_request(values);
        } else if (item.getText(1).equals(tcm.getShowStRequest())) {
            targetConfigInfo.setCas_st_request(values);
        } else if (item.getText(1).equals(tcm.getShowStTransaction())) {
            targetConfigInfo.setCas_st_transaction(values);
        } else if (item.getText(1).equals(tcm.getShowStActiveSession())) {
            targetConfigInfo.setCas_st_active_session(values);
        } else if (item.getText(1).equals(tcm.getShowStQuery())) {
            targetConfigInfo.setCas_st_query(values);
        } else if (item.getText(1).equals(tcm.getShowStLongQuery())) {
            targetConfigInfo.setCas_st_long_query(values);
        } else if (item.getText(1).equals(tcm.getShowStLongTran())) {
            targetConfigInfo.setCas_st_long_tran(values);
        } else if (item.getText(1).equals(tcm.getShowStErrQuery())) {
            targetConfigInfo.setCas_st_error_query(values);
        }
    }
    statusTemplateInfo.addTarget_config(targetConfigInfo);
    super.okPressed();
}
Also used : TargetConfigMap(com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap) TableItem(org.eclipse.swt.widgets.TableItem) TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Example 5 with TargetConfigInfo

use of com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo in project cubrid-manager by CUBRID.

the class StatusMonitorViewPart method initSection.

/**
	 *Initializes the page
	 * 
	 */
private void initSection() {
    ICubridNode selection = getCubridNode();
    site = selection.getServer().getServerInfo();
    StatusTemplateInfo statusTemplateInfo = (StatusTemplateInfo) selection.getAdapter(StatusTemplateInfo.class);
    String samplingTerm = statusTemplateInfo.getSampling_term();
    dbName = statusTemplateInfo.getDb_name();
    if (dbName == null) {
        dbName = "";
    }
    term = Integer.parseInt(samplingTerm);
    List<TargetConfigInfo> list = statusTemplateInfo.getTargetConfigInfoList();
    TargetConfigInfo targetConfigInfo = (TargetConfigInfo) list.get(0);
    numChart = targetConfigInfo.getList().size();
    List<String[]> targetInfos = targetConfigInfo.getList();
    monitorList = new ArrayList<TargetConfig>();
    EnumMap<EnumTargetConfig, TargetConfig> map = TargetConfigMap.getInstance().getMap();
    for (String[] targetInfo : targetInfos) {
        for (TargetConfig tc : map.values()) {
            if (targetInfo[0].equalsIgnoreCase(tc.getName())) {
                tc.setColor(Integer.parseInt(targetInfo[1]));
                tc.setMagnification(Float.parseFloat(targetInfo[2]));
                monitorList.add(tc);
            }
        }
    }
    maximum = new TimeSeries[numChart];
    minimum = new TimeSeries[numChart];
    average = new TimeSeries[numChart];
    current = new TimeSeries[numChart];
    min = new int[numChart];
    max = new int[numChart];
    avg = new double[numChart];
    currentTxt = new Text[numChart];
    minTxt = new Text[numChart];
    maxTxt = new Text[numChart];
    avgTxt = new Text[numChart];
}
Also used : StatusTemplateInfo(com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfo) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) TargetConfigInfo(com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)

Aggregations

TargetConfigInfo (com.cubrid.cubridmanager.core.monitoring.model.TargetConfigInfo)9 StatusTemplateInfo (com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfo)6 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)2 StatusTemplateInfos (com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos)2 TargetConfigMap (com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfigMap)2 TableItem (org.eclipse.swt.widgets.TableItem)2 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)1 EnumTargetConfig (com.cubrid.cubridmanager.ui.monitoring.editor.EnumTargetConfig)1 TargetConfig (com.cubrid.cubridmanager.ui.monitoring.editor.TargetConfig)1 EnumMap (java.util.EnumMap)1 Map (java.util.Map)1