All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.clustering.RequestBenchmarkData Maven / Gradle / Ivy

There is a newer version: 0.27
Show newest version
package io.hyperfoil.clustering;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import io.hyperfoil.api.config.BenchmarkData;

public class RequestBenchmarkData implements BenchmarkData {
   private final Map files = new HashMap<>();

   public void addFile(String name, byte[] bytes) {
      files.put(Objects.requireNonNull(name), Objects.requireNonNull(bytes));
   }

   @Override
   public InputStream readFile(String file) {
      byte[] bytes = files.get(file);
      if (bytes == null) {
         return null;
      }
      return new ByteArrayInputStream(bytes);
   }

   @Override
   public Map files() {
      return files;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy