- Intel Corporation | EHualu Corporation
+ Intel Corporation | eHualu Corporation(Contact me via WeChat: SineCelia)
<#-- end of content -->
diff --git a/dev/cosbench-controller-web/favicon.ico b/dev/cosbench-controller-web/favicon.ico
new file mode 100644
index 0000000..ac022c1
Binary files /dev/null and b/dev/cosbench-controller-web/favicon.ico differ
diff --git a/dev/cosbench-controller-web/src/com/intel/cosbench/controller/web/WorkloadConfigGenerator.java b/dev/cosbench-controller-web/src/com/intel/cosbench/controller/web/WorkloadConfigGenerator.java
index b0f4b1a..642986d 100644
--- a/dev/cosbench-controller-web/src/com/intel/cosbench/controller/web/WorkloadConfigGenerator.java
+++ b/dev/cosbench-controller-web/src/com/intel/cosbench/controller/web/WorkloadConfigGenerator.java
@@ -41,525 +41,477 @@
public class WorkloadConfigGenerator {
- private String runtime;
- private String delay;
- private String rampup;
- private String num_of_drivers;
- private String auth_type;
- private String auth_config;
- private String storage_type;
- private String storage_config;
- private boolean generateWorkloadFiles;
- private File WORKLOAD_CONFIG_DIR;
- private static final String workloadConfigFilesRoot = "workloads";
- protected ControllerService controller;
-
- private static final Logger LOGGER = LogFactory.getSystemLogger();
-
-
- public WorkloadConfigGenerator(ControllerService controller) {
- this.controller = controller;
- }
-
-
- public void createWorkloadFiles(HttpServletRequest req) throws Exception {
-
- // Set common workload parameters
- setWorkloadParams(req);
-
- String workloadMatrixName = req.getParameter("workload.matrix.name");
- if(!workloadMatrixName.matches("[a-zA-Z0-9\\_\\-#\\.\\(\\)\\/%&]{3,50}"))
- throw new Exception("Workload Matrix Name incorrect. Please use alphabets or numbers. Special characters allowed are _ - # . ( ) / % &. "
- + "Length should be between 3 to 50 characters.");
- String objectSizeStrings[] = req.getParameterValues("object-sizes");
- if (objectSizeStrings == null)
- return;
-
- for (int i = 0; i < objectSizeStrings.length; i++) {
- String workloadName = req.getParameterValues("workload.name")[i];
- if(!workloadName.matches("[a-zA-Z0-9\\_\\-#\\.\\(\\)\\/%&]{3,50}"))
- throw new Exception("Workload Name incorrect. Please use alphabets or numbers. Special characters allowed are _ - # . ( ) / % &. "
- + "Length should be between 3 to 50 characters.");
- }
-
- String workloadNumbers[] = req.getParameterValues("workload-number");
- for (int i = 0; i < workloadNumbers.length; i++) {
- String objectSizes[], unit;
- boolean isRange;
-
- int workloadNumber = Integer.parseInt(workloadNumbers[i]);
- String objectSizeString = objectSizeStrings[i];
- // if input is range of object sizes
- if (objectSizeString.contains("-")) {
- objectSizes = objectSizeString.split("-");
- unit = req.getParameterValues("object-size-unit")[i];
- isRange = true;
- }
- // if input is comma separated object size values
- else {
- objectSizes = objectSizeString.split(",");
- unit = req.getParameterValues("object-size-unit")[i];
- isRange = false;
- }
-
- // parsing number of objects
- String objects[] = req.getParameterValues("num-of-objects")[i]
- .split(",");
- // parsing number of containers
- String containers[] = req.getParameterValues("num-of-containers")[i]
- .split(",");
-
- //Get read, write and delete ratios for one workload in string array.
-
- String rWDRatios[] = getRWDRatios(req,workloadNumber+"");
-
- // parsing comma separated worker values
- String workers[] = req.getParameterValues("workers")[i].split(",");
-
- Workload workload = constructWorkload(req, objectSizes, containers,
- objects, workers, rWDRatios,
- isRange, unit);
-
- workload.validate();
-
- String workloadName = req.getParameterValues("workload.name")[workloadNumber];
- workload.setName(workloadName);
-
- if (generateWorkloadFiles)
- {
- WORKLOAD_CONFIG_DIR = new File(workloadConfigFilesRoot+"/"+workloadMatrixName);
- if (!WORKLOAD_CONFIG_DIR.exists())
- WORKLOAD_CONFIG_DIR.mkdirs();
- String path = WORKLOAD_CONFIG_DIR.getAbsolutePath();
- LOGGER.info("using {} for storing generated workload configs", path);
-
- printWorkloadConfigXML(workload, workloadName);
- }
- else
- {
- submitWorkload(workload);
- }
- }
- }
-
- private String[] getRWDRatios(HttpServletRequest req, String workloadNumber) {
- String[] readRatios = req.getParameterValues("read-ratio"+workloadNumber);
- String[] writeRatios = req.getParameterValues("write-ratio"+workloadNumber);
- String[] deleteRatios = req.getParameterValues("delete-ratio"+workloadNumber);
- String[] rwdRatios = new String[readRatios.length];
- for(int i=0; i