Search in sources :

Example 1 with DbProcStatEnum

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

the class DatabaseDashboardViewPart method init.

/**
	 * Initializes
	 *
	 * @param dbNode The DatabaseNode
	 */
public void init(DatabaseNode dbNode) {
    this.dbNode = dbNode;
    HostNode hostNode = dbNode.getParent();
    String partName = getPartName();
    String suffix = " - " + dbNode.getDbName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    if (!partName.endsWith(suffix)) {
        setPartName(partName + suffix);
    }
    ServerInfo serverInfo = hostNode.getServerInfo();
    if (serverInfo != null) {
        String hostAddress = serverInfo.getHostAddress();
        int monPort = serverInfo.getHostMonPort();
        historyFileName = HistoryComposite.DBDASHBOARD_HISTORY_FILE_PREFIX + dbNode.getDbName() + "@" + hostAddress + "_" + monPort + HistoryComposite.HISTORY_SUFFIX;
        IPath histPath = CubridManagerCorePlugin.getDefault().getStateLocation();
        historyPath = histPath.toOSString() + File.separator + historyFileName;
        historyFileHelp = new HistoryFileHelp();
        historyFileHelp.setHistoryPath(historyPath);
    }
    List<String> typeLst = new ArrayList<String>();
    for (DbProcStatEnum dbProcEnum : DbProcStatEnum.values()) {
        typeLst.add(dbProcEnum.getName());
    }
    for (StandbyServerStatEnum standbyEnum : StandbyServerStatEnum.values()) {
        typeLst.add(standbyEnum.getName());
    }
    for (DbStatDumpEnum dbDumpEnum : DbStatDumpEnum.values()) {
        typeLst.add(dbDumpEnum.getName());
    }
    typeNames = typeLst.toArray(new String[typeLst.size()]);
    DataGeneratorPool pool = DataGeneratorPool.getInstance();
    String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
    generator = pool.getDataGenerator(generatorName, new DataProvider());
    generator.addDataUpdateListener(this);
}
Also used : IPath(org.eclipse.core.runtime.IPath) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) StandbyServerStatEnum(com.cubrid.cubridmanager.core.monitoring.model.StandbyServerStatEnum) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode) ArrayList(java.util.ArrayList) DataProvider(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider) DbStatDumpEnum(com.cubrid.cubridmanager.core.monitoring.model.DbStatDumpEnum) DbProcStatEnum(com.cubrid.cubridmanager.core.monitoring.model.DbProcStatEnum) DataGeneratorPool(com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool)

Example 2 with DbProcStatEnum

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

the class DbSystemMonitorViewPart method init.

/**
	 * @param site IViewSite the view site
	 * @throws PartInitException if this view was not initialized successfully
	 * @see com.cubrid.common.ui.spi.part.CubridViewPart#init(org.eclipse.ui.IViewSite)
	 */
public void init(IViewSite site) throws PartInitException {
    super.init(site);
    dbProcStatProxy = new DbProcStatProxy();
    hostStatDataProxy = new HostStatDataProxy();
    serverInfo = cubridNode.getServer().getServerInfo();
    if (serverInfo != null) {
        String hostAddress = serverInfo.getHostAddress();
        int monPort = serverInfo.getHostMonPort();
        historyFileName = HistoryComposite.DB_SYSMON_HISTORY_FILE_PREFIX + dbName + "@" + hostAddress + "_" + monPort + HistoryComposite.HISTORY_SUFFIX;
        IPath histPath = CubridManagerCorePlugin.getDefault().getStateLocation();
        historyPath = histPath.toOSString() + File.separator + historyFileName;
        historyFileHelp = new HistoryFileHelp();
        historyFileHelp.setHistoryPath(historyPath);
        List<String> typeLst = new ArrayList<String>();
        for (DbProcStatEnum dbProcEnum : DbProcStatEnum.values()) {
            typeLst.add(dbProcEnum.getName());
        }
        typeNames = typeLst.toArray(new String[typeLst.size()]);
    }
}
Also used : DbProcStatEnum(com.cubrid.cubridmanager.core.monitoring.model.DbProcStatEnum) IPath(org.eclipse.core.runtime.IPath) DbProcStatProxy(com.cubrid.cubridmanager.core.monitoring.model.DbProcStatProxy) ArrayList(java.util.ArrayList) HostStatDataProxy(com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy) HistoryFileHelp(com.cubrid.cubridmanager.ui.mondashboard.editor.HistoryFileHelp)

Aggregations

DbProcStatEnum (com.cubrid.cubridmanager.core.monitoring.model.DbProcStatEnum)2 ArrayList (java.util.ArrayList)2 IPath (org.eclipse.core.runtime.IPath)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 DbProcStatProxy (com.cubrid.cubridmanager.core.monitoring.model.DbProcStatProxy)1 DbStatDumpEnum (com.cubrid.cubridmanager.core.monitoring.model.DbStatDumpEnum)1 HostStatDataProxy (com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy)1 StandbyServerStatEnum (com.cubrid.cubridmanager.core.monitoring.model.StandbyServerStatEnum)1 HistoryFileHelp (com.cubrid.cubridmanager.ui.mondashboard.editor.HistoryFileHelp)1 DataGeneratorPool (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataGeneratorPool)1 DataProvider (com.cubrid.cubridmanager.ui.mondashboard.editor.dispatcher.DataProvider)1 HostNode (com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode)1