FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Expose `duration` through `DispatchInfo` by shsms · Pull Request #121 · frequenz-floss/frequenz-dispatch-python · GitHub

Repository navigation

Expose duration through DispatchInfo - #121

Closed
shsms wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
shsms:dispatch-duration
Closed

shsms wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
shsms:dispatch-duration

Conversation

shsms commented Mar 27, 2025

Copy link
Copy Markdown
Contributor

No description provided.

shsms added 3 commits March 27, 2025 17:32
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Some dispatches need the duration to make an execution plan.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
shsms requested a review from a team as a code owner March 27, 2025 16:40
github-actions Bot added part:docs Affects the documentation part:dispatcher Affects the high-level dispatcher interface labels Mar 27, 2025
Comment on lines 32 to +37
options: dict[str, Any]
"""Additional options."""

duration: timedelta | None
"""The duration of the dispatch."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just suggestion: duration can be in options dict.
However I don't know why you need this so feel free to ignore this comment.

llucax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Requesting changes to avoid accidental merges until we figure this out.

This solution will not work well in the general case.

components=dispatch.target,
dry_run=dispatch.dry_run,
options=dispatch.payload,
duration=dispatch.duration,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is tricky and can be misleading. If you use the high-level interface and you are listening to the start/stop events, or your actor is managed, this duration might not match the time your actor is really running if some dispatches were merged.

I think a better approach would be to include a list of active dispatches, and just pass the full Dispatch object there. Another approach would be to pass here a "merged duration" instead of the raw duration of the current dispatch. Depending on the use case one could be more useful than the other.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I moved the conversation to #119, I think it is more appropriate to discuss the design in the issue.

llucax linked an issue Mar 28, 2025 that may be closed by this pull request
shsms closed this Mar 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:dispatcher Affects the high-level dispatcher interface part:docs Affects the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass duration in DispatchInfo

3 participants


Back | FazBrowse Home | New Git URL