From 19823c899d42a6c26b89770e01768edcacf3329e Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 23 Aug 2021 18:29:04 -0500 Subject: [PATCH] Add full meta to output While the current output may be sufficient for Hydra it's not enough for a more generically useful evaluator. --- src/hydra-eval-jobs.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hydra-eval-jobs.cc b/src/hydra-eval-jobs.cc index bcfecb7..c2fdc23 100644 --- a/src/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs.cc @@ -17,6 +17,8 @@ #include #include +#include + #include #include #include @@ -217,6 +219,16 @@ static void worker( job["maxSilent"] = drv->queryMetaInt("maxSilent", 7200); job["isChannel"] = drv->queryMetaBool("isHydraChannel", false); + nlohmann::json meta; + for (auto & name : drv->queryMetaNames()) { + PathSet context; + std::stringstream ss; + printValueAsJSON(state, true, *drv->queryMeta(name), ss, context); + nlohmann::json field = nlohmann::json::parse(ss.str()); + meta[name] = field; + } + job["meta"] = meta; + /* If this is an aggregate, then get its constituents. */ auto a = v->attrs->get(state.symbols.create("_hydraAggregate")); if (a && state.forceBool(*a->value, *a->pos)) {