String script = getProcessAndThreadPolicyScript();
ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
engine.eval(script);
int processCount = ((Double) engine.eval("getProcessCount(" + newVuser + ")")).intValue();
int threadCount = ((Double) engine.eval("getThreadCount(" + newVuser + ")")).intValue();
return new ProcessAndThread(processCount, threadCount);
} catch (ScriptException e) {
LOGGER.error("Error occurs while calc process and thread", e);
}
return new ProcessAndThread(1, 1);
}