Introduce minimum bounds#39
Conversation
|
Could you also mention somewhere, either in the PR or in the commit, what the (generic) motivation for this change is, and how this change solves the problem? Or linking/mentioning an issue is also fine. What I understand is that the target power I guess that makes sense if the two bounds will always overlap, with So we are just trying to enforce a minimum power in either direction, by setting Is that accurate? May be worth mention in the doc-comments. |
I have linked the issue. |
It's correct. The details of this behaviour is already present in the documentation, as well as in the release notes. Maybe you can point me toward exactly what detail is missing in the existing docs? I'll update those then. |
when I was reading the docs, this was what took me the longest to figure out, that: the two bounds will always overlap, system_bounds_max will be a broader range, and we reject power requests within system_bounds_min, which I expect would lie around 0. once I made that connection, I could guess the point of having the two bounds. So maybe just something like that - the relation between the min and the max bounds? |
f4a5c85 to
8132e15
Compare
I extended the existing docs to make it clearer how the min and the max bounds are supposed to be related. Please lemme know if the changes make sense. |
yup, I guess so. Maybe @leandro-lucarella-frequenz wants to take a look as well? |
leandro-lucarella-frequenz
left a comment
There was a problem hiding this comment.
Maybe because I'm missing the original context, but I find this extremely confusing and hard to understand.
If I finally got to understand it, after reading the docs on the specs, it seems like the min bounds is a range that will be rejected and max is a range that will be accepted. If this is the case, then it looks more like inclusion/exclusion lists, but with ranges. So if they are ranges, and using set algebra, then the values will be accepted only if in max - min, right?
- max.lower max.upper +
<-------|============|--------------|==========|-------->
min.lower min.upper
---- rejected
==== accepted
Does this look OK? If so, what about naming these something more like system_accept_range and system_reject_zone? I would go with asymmetric names (i.e. not both zone or range) to try to make it more clear that one narrows the range of the other. It might be something else, but I would try to go more this route than min/max which is very confusing to me.
This was also a mystery for me, I think it would be good to mention the use case for this in the bounds docs, if not at least very briefly. I mean, even after understanding the concept, I'm not sure why the reject zone is needed, what would be the use case for it. |
Maybe also include the ascii diagram I put above for extra clarity. |
Correct.
How about
Sure, I can add something.
Sounds like overkill, but sure. |
For me the bounds word here is confusing, even if at the end is represented by a |
I agree it is redundant, but at least in my case, being a visual person, if I see the diagram I understand it instantly, while going through the text takes a bit more time and effort :) |
|
Just for the records, we talked with @tiyash-basu-frequenz and agreed on
|
This indicates the bounds hierarchy better: the rated bounds come from the manufacturer, the component bounds come from the hardware, the system bounds come from our system Signed-off-by: Tiyash Basu <tiyash.basu@frequenz.com>
In the messages `common.Metric` and `common.MetricAggregation`,
`system_bounds` has now been replaced by `system_exclusion_bounds` and
`system_inclusion_bounds`. A metric's `value` now has to comply with the
following constraints:
* `value <= system_exclusion_bounds.lower` OR
`system_exclusion_bounds.upper <= value`
* `system_inclusion_bounds.lower <= value <= system_inclusion_bounds.upper`
`system_inclusion_bounds` behave in the same manner as the earlier
`system_bounds`.
The following diagram illustrates the relationship between the exclusion
and inclusion bounds.
```
inclusion.lower inclusion.upper
<-------|============|------------------|============|--------->
exclusion.lower exclusion.upper
```
`----` values here are disallowed and wil be rejected, and
`====` values here are allowed and will be accepted.
Signed-off-by: Tiyash Basu <tiyash.basu@frequenz.com>
8132e15 to
cce5d7a
Compare
|
Updated. Ready for another look. |
Each of the new RPCs accept a single `SetBoundsParam` object, and returns the UTC timestamp until which the given bounds will stay in effect. The addition of the new RPCs deprecates the older RPC `SetBounds`, which just sets the inclusion bounds. Signed-off-by: Tiyash Basu <tiyash.basu@frequenz.com>
cce5d7a to
40482c7
Compare
leandro-lucarella-frequenz
left a comment
There was a problem hiding this comment.
Haha, I see you made sure it is clarified everywhere 😆
For me it would be also good to put the explanation in one place and in the other places say "see the documentation for XXX".
But anyway this is good to go for me! ![]()
I think it's better to keep it like this for now, given we are looking into extracting some common protobuf messages out into a new repo. This ensures that we do not need to copy documentation from different places, reducing chances of copy-paste errors. I will merge the PR now. |
In the message
common.Metric,system_boundshas now been replaced bysystem_bounds_minandsystem_bounds_max. A metric valuevshould now follow the following constraint:v >= system_bounds_max.lowerANDv <= system_bounds_min.lowerANDv >= system_bounds_min.upperANDv <= system_bounds_max.upperAlso, two new simple RPCs have been added:
AddMinBounds: adds a minimum bound pair, and returns the UTC timestamp until when it will stay in effect.AddMaxBounds: adds a maximum bound pair, and returns the UTC timestamp until when it will stay in effect.and the RPC
SetBoundshas been deprecated.