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VJSAC K5G5GZY7D7KWVR5RAGZFHH3ZPG5OCLZT4HZ6XIJJ7YYVUMC2CTZQC if (!fileExists(narInfo.url)) upsertFile(narInfo.url, narXz);
if (!fileExists(narInfo.url)) {stats.narWrite++;upsertFile(narInfo.url, narXz);} elsestats.narWriteAverted++;stats.narWriteBytes += nar.size();stats.narWriteCompressedBytes += narXz.size();stats.narWriteCompressionTimeMs += duration;
struct Stats{std::atomic<uint64_t> narInfoRead{0};std::atomic<uint64_t> narInfoWrite{0};std::atomic<uint64_t> narRead{0};std::atomic<uint64_t> narReadBytes{0};std::atomic<uint64_t> narReadCompressedBytes{0};std::atomic<uint64_t> narWrite{0};std::atomic<uint64_t> narWriteAverted{0};std::atomic<uint64_t> narWriteBytes{0};std::atomic<uint64_t> narWriteCompressedBytes{0};std::atomic<uint64_t> narWriteCompressionTimeMs{0};};
#if 0auto store = make_ref<LocalBinaryCacheStore>(getLocalStore(),"/home/eelco/Misc/Keys/test.nixos.org/secret","/home/eelco/Misc/Keys/test.nixos.org/public","/tmp/binary-cache");#endifauto store = std::make_shared<S3BinaryCacheStore>([]() { return openStore(); },"/home/eelco/Misc/Keys/test.nixos.org/secret","/home/eelco/Misc/Keys/test.nixos.org/public","nix-test-cache-3");;store->init();_destStore = store;
root.attr("avgStepTime"); out << (float) totalStepTime / nrStepsDone;root.attr("avgStepBuildTime"); out << (float) totalStepBuildTime / nrStepsDone;
root.attr("avgStepTime", (float) totalStepTime / nrStepsDone);root.attr("avgStepBuildTime", (float) totalStepBuildTime / nrStepsDone);
nested2.attr("avgStepTime"); out << (float) s->totalStepTime / s->nrStepsDone;nested2.attr("avgStepBuildTime"); out << (float) s->totalStepBuildTime / s->nrStepsDone;
nested2.attr("avgStepTime", (float) s->totalStepTime / s->nrStepsDone);nested2.attr("avgStepBuildTime", (float) s->totalStepBuildTime / s->nrStepsDone);
auto store = dynamic_cast<S3BinaryCacheStore *>(&*getDestStore());if (store) {root.attr("store");JSONObject nested(out);auto & stats = store->getStats();nested.attr("narInfoRead", stats.narInfoRead);nested.attr("narInfoWrite", stats.narInfoWrite);nested.attr("narRead", stats.narRead);nested.attr("narReadBytes", stats.narReadBytes);nested.attr("narReadCompressedBytes", stats.narReadCompressedBytes);nested.attr("narWrite", stats.narWrite);nested.attr("narWriteAverted", stats.narWriteAverted);nested.attr("narWriteBytes", stats.narWriteBytes);nested.attr("narWriteCompressedBytes", stats.narWriteCompressedBytes);nested.attr("narWriteCompressionTimeMs", stats.narWriteCompressionTimeMs);nested.attr("narCompressionSavings",stats.narWriteBytes? 1.0 - (double) stats.narWriteCompressedBytes / stats.narWriteBytes: 0.0);nested.attr("narCompressionSpeed", // MiB/sstats.narWriteCompressionTimeMs? (double) stats.narWriteBytes / stats.narWriteCompressionTimeMs * 1000.0 / (1024.0 * 1024.0): 0.0);auto s3Store = dynamic_cast<S3BinaryCacheStore *>(&*store);if (s3Store) {nested.attr("s3");JSONObject nested2(out);auto & s3Stats = s3Store->getS3Stats();nested2.attr("put", s3Stats.put);nested2.attr("putBytes", s3Stats.putBytes);nested2.attr("putTimeMs", s3Stats.putTimeMs);nested2.attr("putSpeed",s3Stats.putTimeMs? (double) s3Stats.putBytes / s3Stats.putTimeMs * 1000.0 / (1024.0 * 1024.0): 0.0);nested2.attr("get", s3Stats.get);nested2.attr("getBytes", s3Stats.getBytes);nested2.attr("getTimeMs", s3Stats.getTimeMs);nested2.attr("getSpeed",s3Stats.getTimeMs? (double) s3Stats.getBytes / s3Stats.getTimeMs * 1000.0 / (1024.0 * 1024.0): 0.0);nested2.attr("head", s3Stats.head);nested2.attr("costDollarApprox",(s3Stats.get + s3Stats.head) / 10000.0 * 0.004+ s3Stats.put / 1000.0 * 0.005 ++ s3Stats.getBytes / (1024.0 * 1024.0 * 1024.0) * 0.09);}}
#if 0auto store = make_ref<LocalBinaryCacheStore>(getLocalStore(),"/home/eelco/Misc/Keys/test.nixos.org/secret","/home/eelco/Misc/Keys/test.nixos.org/public","/tmp/binary-cache");#endifauto store = std::make_shared<S3BinaryCacheStore>([]() { return openStore(); },"/home/eelco/Misc/Keys/test.nixos.org/secret","/home/eelco/Misc/Keys/test.nixos.org/public","nix-test-cache-3");;store->init();_destStore = store;