forked from lix-project/lix
nix build --json: Only show non-zero startTime / stopTime
This commit is contained in:
parent
880e7b8ed6
commit
a74d397549
|
@ -27,8 +27,10 @@ nlohmann::json builtPathsWithResultToJSON(const std::vector<BuiltPathWithResult>
|
||||||
std::visit([&](const auto & t) {
|
std::visit([&](const auto & t) {
|
||||||
auto j = t.toJSON(store);
|
auto j = t.toJSON(store);
|
||||||
if (b.result) {
|
if (b.result) {
|
||||||
j["startTime"] = b.result->startTime;
|
if (b.result->startTime)
|
||||||
j["stopTime"] = b.result->stopTime;
|
j["startTime"] = b.result->startTime;
|
||||||
|
if (b.result->stopTime)
|
||||||
|
j["stopTime"] = b.result->stopTime;
|
||||||
if (b.result->cpuUser)
|
if (b.result->cpuUser)
|
||||||
j["cpuUser"] = ((double) b.result->cpuUser->count()) / 1000000;
|
j["cpuUser"] = ((double) b.result->cpuUser->count()) / 1000000;
|
||||||
if (b.result->cpuSystem)
|
if (b.result->cpuSystem)
|
||||||
|
|
Loading…
Reference in a new issue