use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.
the class Registry method printLayout.
public String printLayout() {
StringBuilder sb = new StringBuilder();
sb.append(HORIZONTAL_RULER).append('\n');
sb.append("Cluster layout").append('\n');
sb.append(HORIZONTAL_RULER).append('\n');
for (AgentData agent : agents) {
Set<String> agentVersionSpecs = agent.getVersionSpecs();
int agentMemberWorkerCount = agent.getCount("member");
int agentClientWorkerCount = agent.getWorkers().size() - agentMemberWorkerCount;
int totalWorkerCount = agentMemberWorkerCount + agentClientWorkerCount;
String message = " Agent %s (%s) members: %s, clients: %s";
if (totalWorkerCount > 0) {
message += ", version specs: %s";
} else {
message += " (no workers)";
}
sb.append(format(message, agent.formatIpAddresses(), agent.getAddress(), formatLong(agentMemberWorkerCount, 2), formatLong(agentClientWorkerCount, 2), agentVersionSpecs)).append('\n');
for (WorkerData worker : agent.getWorkers()) {
WorkerParameters parameters = worker.getParameters();
sb.append(" Worker ").append(worker.getAddress()).append(" ").append(parameters.getWorkerType()).append(" [").append(parameters.get("VERSION_SPEC")).append("]").append('\n');
}
}
List<TestData> tests = new ArrayList<TestData>(this.tests.values());
sb.append(format(" Tests %s", tests.size())).append('\n');
for (TestData test : tests) {
sb.append(" ").append(test.getTestCase().getId()).append(" ").append(test.getStatusString()).append('\n');
}
return sb.toString();
}
use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.
the class DeploymentPlan method addToPlan.
public DeploymentPlan addToPlan(int workerCount, String workerType) {
for (int i = 0; i < workerCount; i++) {
WorkersPerAgent workersPerAgent = nextAgent(workerType);
AgentData agent = workersPerAgent.agent;
WorkerParameters workerParameters = vendorDriver.loadWorkerParameters(workerType, agent.getAddressIndex());
workersPerAgent.registerWorker(workerParameters);
List<WorkerParameters> workerParametersList = workerDeployment.get(agent.getAddress());
workerParametersList.add(workerParameters);
}
return this;
}
use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.
the class DeploymentPlanTest method assertDeploymentPlanWorkerCount.
private void assertDeploymentPlanWorkerCount(DeploymentPlan plan, SimulatorAddress agentAddress, int memberCount, int clientCount) {
List<WorkerParameters> settingsList = plan.getWorkerDeployment().get(agentAddress);
assertNotNull(format("Could not find WorkerParameters for Agent %s , workerDeployment: %s", agentAddress, plan.getWorkerDeployment()), settingsList);
int actualMemberWorkerCount = 0;
int actualClientWorkerCount = 0;
for (WorkerParameters workerProcessSettings : settingsList) {
if (workerProcessSettings.getWorkerType().equals("member")) {
actualMemberWorkerCount++;
} else {
actualClientWorkerCount++;
}
}
String prefix = format("Agent %s members: %d clients: %d", agentAddress, actualMemberWorkerCount, actualClientWorkerCount);
assertEquals(prefix + " (memberWorkerCount)", memberCount, actualMemberWorkerCount);
assertEquals(prefix + " (clientWorkerCount)", clientCount, actualClientWorkerCount);
}
use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.
the class RegistryTest method testAddWorkers.
@Test
public void testAddWorkers() {
SimulatorAddress agentAddress = addAgent();
List<WorkerParameters> parametersList = newWorkerParametersList(agentAddress, 10);
assertEquals(0, registry.workerCount());
registry.addWorkers(parametersList);
assertEquals(10, registry.workerCount());
}
use of com.hazelcast.simulator.agent.workerprocess.WorkerParameters in project hazelcast-simulator by hazelcast.
the class RegistryTest method testHasClientWorkers_withoutClientWorkers.
@Test
public void testHasClientWorkers_withoutClientWorkers() {
SimulatorAddress agentAddress = addAgent();
List<WorkerParameters> parametersList = newWorkerParametersList(agentAddress, 2);
registry.addWorkers(parametersList);
assertFalse(registry.hasClientWorkers());
}
Aggregations