go(stats): relocate stats to common outdir
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
96a93788da
commit
2697b296b5
@ -7,6 +7,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"git.dotya.ml/wanderer/math-optim/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchRound holds the iteration couter value and Results of size 'maxFES'.
|
// BenchRound holds the iteration couter value and Results of size 'maxFES'.
|
||||||
@ -50,9 +52,14 @@ func GetStats(algo string, dimens int, benchFuncStats []FuncStats, iterations, g
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SaveStats(stats []Stats, fName string) {
|
func SaveStats(stats []Stats, fName string) {
|
||||||
prefix := "res/stats/"
|
prefix := "out/stats/"
|
||||||
ext := ".json"
|
ext := ".json"
|
||||||
|
|
||||||
|
// create required folders, bail early in case of an error.
|
||||||
|
if err := util.CreatePath(prefix); err != nil {
|
||||||
|
log.Fatalln("went to create stats dir, there was an issue: ", err)
|
||||||
|
}
|
||||||
|
|
||||||
if j, err := json.MarshalIndent(stats, "", " "); err != nil {
|
if j, err := json.MarshalIndent(stats, "", " "); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user