Skip to content
Snippets Groups Projects
Commit 51f09239 authored by Petr Bainar's avatar Petr Bainar
Browse files

iss1011: implementing Task sorting

parent 03cb32eb
No related branches found
No related tags found
1 merge request!6Iss1011
...@@ -14,6 +14,8 @@ import java.util.ArrayList; ...@@ -14,6 +14,8 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -206,6 +208,10 @@ public class BenchmarkJobManager { ...@@ -206,6 +208,10 @@ public class BenchmarkJobManager {
break; break;
} }
scanner.close(); scanner.close();
// Order tasks chronologically
List<String> chronologicList = Constants.STATISTICS_TASK_NAME_MAP.keySet().stream().collect(Collectors.toList());
Collections.sort(tasks, Comparator.comparingInt(task -> chronologicList.indexOf(task.getDescription())));
} }
private void setDownloaded(boolean b) { private void setDownloaded(boolean b) {
......
package cz.it4i.fiji.haas_spim_benchmark.core; package cz.it4i.fiji.haas_spim_benchmark.core;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
public interface Constants { public interface Constants {
...@@ -22,7 +22,7 @@ public interface Constants { ...@@ -22,7 +22,7 @@ public interface Constants {
String STATISTICS_RESOURCES_WALL_TIME = "resources_used.walltime"; String STATISTICS_RESOURCES_WALL_TIME = "resources_used.walltime";
String STATISTICS_RESOURCES_CPU_PERCENTAGE = "resources_used.cpupercent"; String STATISTICS_RESOURCES_CPU_PERCENTAGE = "resources_used.cpupercent";
Map<String, String> STATISTICS_TASK_NAME_MAP = new HashMap<String, String>() { Map<String, String> STATISTICS_TASK_NAME_MAP = new LinkedHashMap<String, String>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
{ {
put("define_xml_tif", "Define dataset"); put("define_xml_tif", "Define dataset");
...@@ -36,6 +36,7 @@ public interface Constants { ...@@ -36,6 +36,7 @@ public interface Constants {
put("define_output", "Define output"); put("define_output", "Define output");
put("hdf5_xml_output", "Define hdf5 output"); put("hdf5_xml_output", "Define hdf5 output");
put("resave_hdf5_output", "Resave output to hdf5"); put("resave_hdf5_output", "Resave output to hdf5");
put("done", "Done");
}}; }};
String STATISTICS_SUMMARY_FILENAME = "summary.csv"; String STATISTICS_SUMMARY_FILENAME = "summary.csv";
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment