frequenz-floss / frequenz-sdk-python

Frequenz Python Software Development Kit (SDK)
https://frequenz-floss.github.io/frequenz-sdk-python/
MIT License
13 stars 17 forks source link

SDK power_status interface to receive bounds is very spammy #818

Open Marenz opened 9 months ago

Marenz commented 9 months ago

What happened?

The new versions of the SDK send power bounds updates multiple times per second without any bound changing. This is visible both with real hardware and with the sandbox:

17:41:48,031,31 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,037,37 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,237,237 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,246,246 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,435,435 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,443,443 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,636,636 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,646,646 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,840,840 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:48,846,846 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,025,25 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,034,34 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,240,240 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,248,248 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,430,430 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,437,437 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,635,635 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,641,641 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW] 17:41:49,837,837 INFO [fcr_balancing_actor.py:243] Battery power bounds changed to [-1.262 MW, 1.31 MW]

What did you expect instead?

.

Affected version(s)

No response

Affected part(s)

Data pipeline (part:data-pipeline)

Extra information

No response

Marenz commented 9 months ago

See also the current workaround https://github.com/frequenz-io/frequenz-actor-fcr-balancing/pull/313

shsms commented 3 months ago

I guess the big reason for having so many messages is that we're bundling multiple things - bounds, target_power and power_distributor_result - into the same Report types.

And I guess mostly people are only interested in bounds, but end up getting other stuff.

I'm thinking of splitting it into 3 different streams, and people can subscribe to just the stuff they're interested in. I'll see if such an interface can be made to look nice.

shsms commented 3 months ago

This should partially solve it: https://github.com/frequenz-floss/frequenz-sdk-python/pull/998

Next, we need to de-duplicate messages instead of repeatedly sending the same report again and again.