use of com.cubrid.cubridmanager.core.monitoring.model.DiagStatusResult in project cubrid-manager by CUBRID.
the class GetDiagdataTask method getResult.
/**
* Gets the instance of Type DiagStatusResult
*
* @return DiagStatusResult
*/
public DiagStatusResult getResult() {
DiagStatusResult diagStatusResult = new DiagStatusResult();
TreeNode node = getResponse();
if (node == null || (getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
finish();
return diagStatusResult;
}
for (TreeNode childNode : node.getChildren()) {
setFieldValue(childNode, diagStatusResult);
}
return diagStatusResult;
}
use of com.cubrid.cubridmanager.core.monitoring.model.DiagStatusResult in project cubrid-manager by CUBRID.
the class StatusMonitorViewPart method getUpdateValue.
/**
* Get update value
*
* @param startRun int
* @return Map<String, String>
*/
private Map<String, String> getUpdateValue(int startRun) {
GetDiagdataTask task = new GetDiagdataTask(site);
if (dbName.trim().length() > 0) {
task.setDbname(dbName);
}
List<String> monitorNameList = new ArrayList<String>();
for (TargetConfig tc : monitorList) {
monitorNameList.add(tc.getMonitorName());
}
task.buildMsg(monitorNameList);
task.setUsingSpecialDelimiter(true);
task.execute();
Map<String, String> resultMap = null;
if (!task.isSuccess()) {
return null;
}
float inter = 0.0f;
if (startRun == 0) {
diagStatusResult = task.getResult();
return diagStatusResult.getDiagStatusResultMap();
} else if (startRun == 1) {
lastSec = Calendar.getInstance();
diagOldOneStatusResult.copy_from(diagStatusResult);
diagStatusResult = task.getResult();
DiagStatusResult diagStatusResultDelta = new DiagStatusResult();
diagStatusResultDelta.getDelta(diagStatusResult, diagOldOneStatusResult);
return diagStatusResultDelta.getDiagStatusResultMap();
} else {
nowSec = Calendar.getInstance();
double interval = (double) (nowSec.getTimeInMillis() - lastSec.getTimeInMillis()) / 1000;
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(3);
inter = Float.parseFloat(nf.format(interval));
LOGGER.debug("monitorTimes =" + monitorTimes);
LOGGER.debug("lastSec time =" + lastSec.getTimeInMillis());
LOGGER.debug("nowSec time =" + nowSec.getTimeInMillis());
LOGGER.debug("inter =" + inter);
lastSec = nowSec;
diagOldTwoStatusResult.copy_from(diagOldOneStatusResult);
diagOldOneStatusResult.copy_from(diagStatusResult);
diagStatusResult = task.getResult();
DiagStatusResult diagStatusResultDelta = new DiagStatusResult();
diagStatusResultDelta.getDelta(diagStatusResult, diagOldOneStatusResult, diagOldTwoStatusResult, inter);
resultMap = diagStatusResultDelta.getDiagStatusResultMap();
}
return resultMap;
}
Aggregations