Exemplo n.º 1
0
  @Test(groups = {"pillar-stress-test", "stress-test-pillar-population"})
  public void singleTreadedPut() throws Exception {
    final int NUMBER_OF_FILES = 10;
    final int PART_STATISTIC_INTERVAL = 2;
    addDescription("Attempt to put " + NUMBER_OF_FILES + " files into the pillar, one at a time.");
    BlockingPutFileClient blockingPutFileClient = new BlockingPutFileClient(putClient);
    String[] fileIDs = TestFileHelper.createFileIDs(NUMBER_OF_FILES, "singleTreadedPutTest");
    Metrics metrics = new Metrics("put", NUMBER_OF_FILES, PART_STATISTIC_INTERVAL);
    metrics.addAppenders(metricAppenders);
    metrics.start();
    addStep("Add " + NUMBER_OF_FILES + " files", "Not errors should occur");
    for (String fileID : fileIDs) {
      blockingPutFileClient.putFile(
          collectionID,
          httpServerConfiguration.getURL(TestFileHelper.DEFAULT_FILE_ID),
          fileID,
          10L,
          TestFileHelper.getDefaultFileChecksum(),
          null,
          null,
          "singleTreadedPut stress test file");
      metrics.mark(fileID);
    }

    addStep(
        "Check that the files are now present on the pillar(s)",
        "No missing files should be found.");
    // ToDo assert that the files are present
  }
Exemplo n.º 2
0
  @Test(groups = {"pillar-stress-test"})
  public void parallelPut() throws Exception {
    final int numberOfFiles =
        testConfiguration.getInt("pillarintegrationtest.PutFileStressIT.parallelPut.numberOfFiles");
    final int partStatisticsInterval =
        testConfiguration.getInt(
            "pillarintegrationtest.PutFileStressIT.parallelPut.partStatisticsInterval");
    final int numberOfParallelPuts =
        testConfiguration.getInt(
            "pillarintegrationtest.PutFileStressIT.parallelPut.numberOfParallelPuts");
    addDescription(
        "Attempt to put "
            + numberOfFiles
            + " files into the pillar, "
            + numberOfParallelPuts
            + " at 'same' time.");
    String[] fileIDs = TestFileHelper.createFileIDs(numberOfFiles, "parallelPutTest");
    final Metrics metrics = new Metrics("put", numberOfFiles, partStatisticsInterval);
    metrics.addAppenders(metricAppenders);
    metrics.start();
    addStep("Add " + numberOfFiles + " files", "Not errors should occur");
    ParallelPutLimiter putLimiter = new ParallelPutLimiter(numberOfParallelPuts);
    EventHandler eventHandler = new PutEventHandlerForMetrics(metrics, putLimiter);
    for (String fileID : fileIDs) {
      putLimiter.addJob(fileID);
      putClient.putFile(
          collectionID,
          httpServerConfiguration.getURL(TestFileHelper.DEFAULT_FILE_ID),
          fileID,
          10L,
          TestFileHelper.getDefaultFileChecksum(),
          null,
          eventHandler,
          "parallelPut stress test file");
    }

    awaitAsynchronousCompletion(metrics, numberOfFiles);

    addStep(
        "Check that the files are now present on the pillar(s)",
        "No missing files should be found.");
    existingFiles = fileIDs;
  }