;doc: update command docs

This commit is contained in:
Simon Michael 2025-11-19 22:25:25 -10:00
parent f58d3835b1
commit d5ceb7bba3

View File

@ -3,6 +3,7 @@ stats
Show journal and performance statistics. Show journal and performance statistics.
Flags: Flags:
-1 show a single line of output
-v --verbose show more detailed output -v --verbose show more detailed output
-o --output-file=FILE write output to FILE. -o --output-file=FILE write output to FILE.
@ -10,20 +11,24 @@ The stats command shows summary information for the whole journal, or a
matched part of it. With a reporting interval, it shows a report for matched part of it. With a reporting interval, it shows a report for
each report period. each report period.
The default output is fairly impersonal, though it reveals the main file It also shows some performance statistics:
name. With -v/--verbose, more details are shown, like file paths,
included files, and commodity names.
It also shows some run time statistics: - how long the program ran for
- the number of transactions processed per second
- the peak live memory in use by the program to do its work
- the peak allocated memory as seen by the program
- elapsed time By default, the output is reasonably discreet; it reveals the main file
- throughput: the number of transactions processed per second name, your activity level, and the speed of your machine.
- live: the peak memory in use by the program to do its work
- alloc: the peak memory allocation from the OS as seen by GHC.
Measuring this externally, eg with GNU time, is more accurate; usually
that will be a larger number; sometimes (with swapping?) smaller.
The stats command's run time is similar to that of a balance report. With -v/--verbose, more details are shown: the full paths of all files,
and the names of the commodities you work with.
With -1, only one line of output is shown, in a machine-friendly
tab-separated format: the program version, the main journal file name,
and the performance stats,
The run time of stats is similar to that of a balance report.
Example: Example:
@ -41,5 +46,8 @@ Commodities : 26
Market prices : 1000 Market prices : 1000
Runtime stats : 0.12 s elapsed, 8266 txns/s, 4 MB live, 16 MB alloc Runtime stats : 0.12 s elapsed, 8266 txns/s, 4 MB live, 16 MB alloc
$ hledger stats -1 -f examples/10ktxns-1kaccts.journal
1.50.99-g0835a2485-20251119, mac-aarch64 10ktxns-1kaccts.journal 0.66 s elapsed 15244 txns/s 28 MB live 86 MB alloc
This command supports the -o/--output-file option (but not This command supports the -o/--output-file option (but not
-O/--output-format). -O/--output-format).