コード例 #1
0
  private void readStatisticsLogsClients(
      Integer numOfClients, List<ICreateTable> baseTables, String directory) {

    for (ICreateTable createTable : baseTables) {

      int x = 0;

      while (x < numOfClients) {

        Node node = NetworkConfig.CLIENTS.get(x % NetworkConfig.CLIENTS.size());
        log.info(
            this.getClass(),
            "reading statistics log of client "
                + "c"
                + (x + 1)
                + "-filltable-"
                + createTable.getName()
                + " on node: "
                + node);
        SSHService.retrieveFile(
            log,
            node.getSshConnection(),
            SystemConfig.DIRECTORY_VMSYSTEM + "/logs",
            directory + "",
            "c" + (x + 1) + "-filltable-" + createTable.getName() + ".log");
        x++;
      }
    }
  }
コード例 #2
0
  private void stopClients(int numOfClients) {

    int x = 0;

    while (x < numOfClients) {

      Node node = NetworkConfig.CLIENTS.get(x % NetworkConfig.CLIENTS.size());

      log.info(this.getClass(), "stopping client:" + node);

      List<String> stopCommand = new ArrayList<String>();
      stopCommand.add("pkill -9 -f ClientProcess");

      List<String> result = SSHService.sendCommand(log, node.getSshConnection(), stopCommand);
      x++;
    }
    log.info(this.getClass(), "\n");
  }
コード例 #3
0
  public void fillBaseTable(Integer numOfClients, CreateBaseTable createBaseTable) {

    log.info(this.getClass(), "filling base table " + createBaseTable);
    log.info(this.getClass(), "using  " + numOfClients + " client");
    log.info(
        this.getClass(),
        "" + (createBaseTable.getNumOfOperations() / numOfClients) + " operations per client");

    int x = 0;

    //		int messagePort = vmMessagePort;
    while (x < numOfClients) {

      Node node = NetworkConfig.CLIENTS.get(x % NetworkConfig.CLIENTS.size());

      List<String> startupCommand = new ArrayList<String>();
      startupCommand.add("cd /");
      startupCommand.add("cd " + SystemConfig.DIRECTORY_VMSYSTEM);
      startupCommand.add(
          "java -cp vmsystem.jar de.webdataplatform.client.ClientProcess c"
              + (x + 1)
              + " filltable "
              + createBaseTable.getName()
              + " "
              + createBaseTable.getDistribution()
              + " "
              + (createBaseTable.getNumOfOperations() / numOfClients));

      log.info(this.getClass(), "starting client:" + node);
      List<String> result = SSHService.sendCommand(log, node.getSshConnection(), startupCommand);
      x++;
      //			try {
      //				Thread.sleep(2000);
      //			} catch (InterruptedException e) {
      //
      //				e.printStackTrace();
      //			}

    }
    log.info(this.getClass(), "\n");
  }