1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

* Show evaluation stats when NIX_SHOW_STATS=1.

This commit is contained in:
Eelco Dolstra 2006-05-08 10:00:37 +00:00
parent 0832956089
commit 310e605995
3 changed files with 30 additions and 15 deletions

View file

@ -527,9 +527,12 @@ extern "C" {
void printEvalStats(EvalState & state)
{
printMsg(lvlInfo,
bool showStats = getEnv("NIX_SHOW_STATS", "0") != "0";
printMsg(showStats ? lvlInfo : lvlDebug,
format("evaluated %1% expressions, %2% cache hits, %3%%% efficiency, used %4% ATerm bytes")
% state.nrEvaluated % state.nrCached
% ((float) state.nrCached / (float) state.nrEvaluated * 100)
% AT_calcAllocatedSize());
if (showStats)
printATermMapStats();
}