use of com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy in project cubrid-manager by CUBRID.
the class HostSystemMonitorViewPart 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);
hostStatDataProxy = new HostStatDataProxy();
serverInfo = cubridNode.getServer().getServerInfo();
if (serverInfo != null) {
String hostAddress = serverInfo.getHostAddress();
int monPort = serverInfo.getHostMonPort();
historyFileName = HistoryComposite.HOST_SYSMON_HISTORY_FILE_PREFIX + 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 (HostStatEnum hostEnum : HostStatEnum.values()) {
typeLst.add(hostEnum.getName());
}
typeNames = typeLst.toArray(new String[typeLst.size()]);
}
}
use of com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy 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()]);
}
}
use of com.cubrid.cubridmanager.core.monitoring.model.HostStatDataProxy in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method setHostData.
/**
* Set Server Host Data
*/
private void setHostData(ServiceDashboardInfo sDashInfo, HostStatData hostInfo) {
double memUsed = 0, memTotal = 0, cpuUsed = 0;
if (hostInfo != null) {
HostStatDataProxy hostStatDataProxy = new HostStatDataProxy();
HostStatData hostInfo2 = new HostStatData();
hostInfo2.copyFrom(hostInfo);
hostStatDataProxy.compute(hostInfo, hostInfo2);
memUsed = Double.parseDouble(hostStatDataProxy.getMemPhyUsed());
memTotal = Double.parseDouble(hostStatDataProxy.getMemPhyTotal());
cpuUsed = Double.parseDouble(hostStatDataProxy.getUserPercent());
}
sDashInfo.setMemUsed(memUsed);
sDashInfo.setMemTotal(memTotal);
sDashInfo.setCpuUsed(cpuUsed);
}
Aggregations