does pants expose any performance / visualization ...
# general
f
does pants expose any performance / visualization tooling to help consumers know where time is being spent? bazel has this chrome profiler which is neat https://bazel.build/advanced/performance/json-trace-profile Even a simple “time by target type” would be helpful to me at the moment
c
There is https://www.pantsbuild.org/2.19/reference/subsystems/stats which will present some cache metrics.. don't think it presents data per target etc however..
f
yeah that mostly presents data around caching hits/read/writes I think
b
You can get some of this via https://www.pantsbuild.org/2.19/reference/subsystems/workunit-logger That's highly experimental and very under-documented, but I think it outputs a JSON file that could be transformed into formats for other tools to consume, like CTF that some tools consume (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview) One could also write a plugin that does it "live". The source for that backend might be a good starting point https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/tools/workunit_logger/rules.py
f
oh very nice. How can I add my own bits of
metadata
from my plugin? I see
span_id
and
parent_id
which indicates its capturing the tree structure, conceptually similar to how open-telemetry works?
b
How can I add my own bits of
metadata
from my plugin?
I don't know; you might have to find someone who does (feel free to ask in #C01CQHVDMMW which is lower volume and so will be more likely for knowledgeable people to notice) or track it that back through the rest of the code.
I see
span_id
and
parent_id
which indicates its capturing the tree structure, conceptually similar to how open-telemetry works?
I believe so, yes
f
thanks 🙏 I think I found it. Theres a metadata method on some of the dataclasses https://github.com/pantsbuild/pants/blob/2e5c50511f809aa3c007bb54924277c3b0348f64/src/python/pants/core/goals/check.py#L63-L64 I’ll try adding some later