provide JSON friendly optimo result

This commit is contained in:
Jonathan Shook 2020-09-10 18:33:42 -05:00
parent f22a04622f
commit 35abcc03a9
2 changed files with 14 additions and 3 deletions

View File

@ -31,6 +31,19 @@ public class MVResult {
return result;
}
public Map<String,Map<String,Double>> getMap() {
Map<String,Map<String,Double>> map = new HashMap<>();
for (int i = 0; i < params.size(); i++) {
Map<String,Double> entry = Map.of(
"min", params.get(i).min,
"max", params.get(i).max,
"value", this.vars[i]
);
map.put(params.get(i).name, entry);
}
return map;
}
public String toString() {
StringBuilder sb = new StringBuilder();
int pos = 0;

View File

@ -285,9 +285,7 @@ function optimo() {
latency_ms: results_array[results_array.length - 1].latency_ms,
ops_per_second: results_array[results_array.length - 1].ops_per_second,
total_seconds: total_seconds,
vars: result.vars,
params: result.params,
log: result.datalog
result: result.map
};
}