-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Is your feature request related to a problem or challenge?
There is currently no way to programmatically inspect the memory consumption of individual consumers tracked by TrackConsumersPool. The only available method, report_top(), returns a formatted string intended for human-readable output, making it unsuitable for programmatic use (e.g., metrics collection, monitoring, or custom reporting).
Describe the solution you'd like
Add a metrics() method to TrackConsumersPool that returns a Vec — a snapshot of all currently tracked consumers. Each MemoryConsumerMetrics entry exposes:
- name — the consumer's name
- can_spill — whether the consumer supports spilling to disk
- reserved — current bytes reserved
- peak — peak bytes reserved
This allows callers to inspect memory usage programmatically without parsing formatted strings.
Describe alternatives you've considered
No response
Additional context
This is useful for embedding DataFusion in systems that want to expose per-operator memory metrics through their own observability pipelines (e.g., Prometheus, OpenTelemetry or custom dashboards).