From ed249888b473d32123f241811949cc82b63da06f Mon Sep 17 00:00:00 2001 From: Unknown <petr.bainar@hotmail.com> Date: Thu, 25 Jan 2018 13:38:11 +0100 Subject: [PATCH] formatStatistics: adding human-readable task names --- .../core/BenchmarkJobManager.java | 2 +- .../haas_spim_benchmark/core/Constants.java | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java index 51f57f4c..c08c18d0 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java @@ -287,7 +287,7 @@ public class BenchmarkJobManager { } for (ResultFileTask task : identifiedTasks) { - Object[] args = {task.name, task.getJobCount(), task.getAverageMemoryUsage()}; + Object[] args = {Constants.STATISTICS_TASK_NAME_MAP.get(task.name), task.getJobCount(), task.getAverageMemoryUsage()}; MessageFormat fmt = new MessageFormat(Constants.STATISTICS_OUTPUT_MESSAGE); System.out.println(fmt.format(args)); } diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java index c5916d28..0e4f436c 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java @@ -1,5 +1,8 @@ package cz.it4i.fiji.haas_spim_benchmark.core; +import java.util.HashMap; +import java.util.Map; + public interface Constants { long HAAS_UPDATE_TIMEOUT = 1000; String HAAS_JOB_NAME = "HaaSSPIMBenchmark"; @@ -19,5 +22,20 @@ public interface Constants { String STATISTICS_RESOURCES_WALL_TIME = "resources_used.walltime"; String STATISTICS_RESOURCES_CPU_PERCENTAGE = "resources_used.cpupercent"; - String STATISTICS_OUTPUT_MESSAGE = "Task {0} needed {1} {1,choice,0#jobs|1#job|1<jobs} and {2} MB of memory in average."; + Map<String, String> STATISTICS_TASK_NAME_MAP = new HashMap<String, String>() { + private static final long serialVersionUID = 1L; + { + put("define_xml_tif", "Define dataset"); + put("hdf5_xml", "Define hdf5 dataset"); + put("resave_hdf5", "Resave to hdf5"); + put("registration", "Detection and registration"); + put("xml_merge", "Merge xml"); + put("timelapse", "Time lapse registration"); + put("fusion", "Average fusion"); + put("deconvolution", "Deconvolution GPU"); + put("define_output", "Define output"); + put("hdf5_xml_output", "Define hdf5 output"); + put("resave_hdf5_output", "Resave output to hdf5"); + }}; + String STATISTICS_OUTPUT_MESSAGE = "{0} needed {1} {1,choice,0#jobs|1#job|1<jobs} and {2} MB of memory in average."; } -- GitLab