Skip to main content
Version: 2.23 (prerelease)

stats


An aggregator for Pants stats, such as cache metrics.

Backend: pants.core

Config section: [stats]

Basic options

format

--stats-format=<StatsOutputFormat>
PANTS_STATS_FORMAT
pants.toml
[stats]
format = <StatsOutputFormat>
one of: text, jsonlines
default: text

Output format for reporting stats.

output_file

--stats-output-file=<path>
PANTS_STATS_OUTPUT_FILE
pants.toml
[stats]
output_file = <path>
default: None

Output the stats to this file. If unspecified, outputs to stdout.

Advanced options

log

--[no-]stats-log
PANTS_STATS_LOG
pants.toml
[stats]
log = <bool>
default: False

At the end of the Pants run, log all counter metrics and summaries of observation histograms, e.g. the number of cache hits and the time saved by caching.

For histogram summaries to work, you must add hdrhistogram to [GLOBAL].plugins.

memory_summary

--[no-]stats-memory-summary
PANTS_STATS_MEMORY_SUMMARY
pants.toml
[stats]
memory_summary = <bool>
default: False

At the end of the Pants run, report a summary of memory usage.

Keys are the total size in bytes, the count, and the name. Note that the total size is for all instances added together, so you can use total_size // count to get the average size.

Deprecated options

None

None