Stats output similar to treefmt.rs #33

Merged
brianmcgee merged 2 commits from feat/stats into main 2024-05-01 12:49:32 +00:00
Member

Helps to understand what happened with the following stats:

  • traversed is the number of files we walked over
  • emitted is the number of files we had no cache entry for, or for which we had a cache entry but the mtime has changed
  • matched is the number of files we matched to one or more formatting pipelines
  • formatted is the number of files that were actually changed

In the example below, we can see that we still emitted some files when using the cache, but none matched to a formatter, and none were subsequently formatted.

treefmt on  feat/stats [$!+?⇡] via 🐹 v1.22.2 via ❄️  impure (devshell-env) on ☁️   took 5s 
❯ nix run .# -- --config-file ./test/examples/nixpkgs.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs -c
traversed 40559 files
emitted 40559 files for processing
matched 33712 files to formatters
formatted 33712 files in 22.270884528s

treefmt on  feat/stats [$!+?⇡] via 🐹 v1.22.2 via ❄️  impure (devshell-env) on ☁️   took 22s 
❯ nix run .# -- --config-file ./test/examples/nixpkgs.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs   
traversed 40559 files
emitted 6847 files for processing
matched 0 files to formatters
formatted 0 files in 270.53513ms
Helps to understand what happened with the following stats: * `traversed` is the number of files we walked over * `emitted` is the number of files we had no cache entry for, or for which we had a cache entry but the `mtime` has changed * `matched` is the number of files we matched to one or more formatting pipelines * `formatted` is the number of files that were actually changed In the example below, we can see that we still emitted some files when using the cache, but none matched to a formatter, and none were subsequently formatted. ```terminal treefmt on  feat/stats [$!+?⇡] via 🐹 v1.22.2 via ❄️ impure (devshell-env) on ☁️ took 5s ❯ nix run .# -- --config-file ./test/examples/nixpkgs.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs -c traversed 40559 files emitted 40559 files for processing matched 33712 files to formatters formatted 33712 files in 22.270884528s treefmt on  feat/stats [$!+?⇡] via 🐹 v1.22.2 via ❄️ impure (devshell-env) on ☁️ took 22s ❯ nix run .# -- --config-file ./test/examples/nixpkgs.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs traversed 40559 files emitted 6847 files for processing matched 0 files to formatters formatted 0 files in 270.53513ms ```
brianmcgee added 3 commits 2024-05-01 10:19:04 +00:00
Moves us to go 1.22

Signed-off-by: Brian McGee <brian@bmcgee.ie>
Signed-off-by: Brian McGee <brian@bmcgee.ie>
Signed-off-by: Brian McGee <brian@bmcgee.ie>
brianmcgee requested review from zimbatm 2024-05-01 10:19:09 +00:00
brianmcgee force-pushed feat/stats from 841441dfef to 04330a39fa 2024-05-01 10:24:18 +00:00 Compare
zimbatm approved these changes 2024-05-01 12:48:33 +00:00
zimbatm left a comment
Owner

very nice!

I was surprised by the ordering between the match and the cache, but just because it's the other way around in the rust impl.

very nice! I was surprised by the ordering between the match and the cache, but just because it's the other way around in the rust impl.
brianmcgee merged commit 618f6f7e77 into main 2024-05-01 12:49:32 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: numtide/treefmt#33
No description provided.