From dc712d201627f44383cb59c23c8c7f98cadc3c5a Mon Sep 17 00:00:00 2001 From: kannibalox Date: Mon, 24 Oct 2022 13:30:53 -0400 Subject: [PATCH] Pull fix for example custom tracker field from pyrocore https://github.com/pyroscope/pyrocore/pull/105 --- CHANGELOG.md | 4 ++++ docs/examples/custom-fields-trackers.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9295b4d..95f214eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed +- Use all trackers when aggregating in example custom field code + (credit goes to @kchiem: https://github.com/pyroscope/pyrocore/pull/105) + ## [2.2.1] - 2022-10-24 ### Fixed diff --git a/docs/examples/custom-fields-trackers.py b/docs/examples/custom-fields-trackers.py index 98454d61..27799f94 100644 --- a/docs/examples/custom-fields-trackers.py +++ b/docs/examples/custom-fields-trackers.py @@ -8,7 +8,7 @@ def _custom_fields(): # Add rTorrent attributes not available by default def get_tracker_field(obj, name, aggregator=sum): "Get an aggregated tracker field." - return aggregator(obj.rpc_call("t.multicall", ["", f"t.{name}="])[0]) + return aggregator([t[0] for t in obj.rpc_call("t.multicall", ["", f"t.{name}="])]) yield engine.DynamicField( int,