Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve stats #2392

Merged
merged 3 commits into from Sep 5, 2018
Merged

Improve stats #2392

merged 3 commits into from Sep 5, 2018

Conversation

cleverca22
Copy link
Contributor

this adds percentages to the bytes in the stats
values allocated: 119 (2856 bytes 45%)
and also adds json:

[clever@amd-nixos:~/apps/nix]$ NIX_SHOW_STATS=json NIX_SHOW_STATS_PATH=foo.json ./result/bin/nix-instantiate --eval -E '5*5'
warning: unknown setting 'build-extra-platforms'
25
evaluation statistics:

[clever@amd-nixos:~/apps/nix]$ jq .values.bytes < foo.json 
2856

@edolstra
Copy link
Member

edolstra commented Sep 2, 2018

Looks good. Could you remove the old stats format? I don't think we need to have both, JSON output is strictly better.

@cleverca22
Copy link
Contributor Author

previously, NIX_SHOW_STATS was changing the verbosity, so the stats could still be seen with -vvvvv
but with the new code, it only shows the json when NIX_SHOW_STATS is non-zero, and it will write to a file if NIX_SHOW_STATS and NIX_SHOW_STATS_PATH are both set

the logic may need to be improved a little more

@edolstra edolstra merged commit 4b034f3 into NixOS:master Sep 5, 2018
@cleverca22 cleverca22 deleted the improve-stats branch September 9, 2018 16:30
@vcunat
Copy link
Member

vcunat commented Jan 13, 2019

Cross-link: NixOS/nixpkgs#53858

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants