-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for streaming (push) history #85892
Merged
Merged
Conversation
This file contains 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
Currently we poll for history data, like logbook we can stream this data to avoid database overhead
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
bdraco
commented
Jan 14, 2023
bdraco
commented
Jan 15, 2023
bdraco
commented
Jan 16, 2023
bdraco
commented
Jan 16, 2023
bdraco
commented
Jan 16, 2023
bdraco
commented
Jan 16, 2023
9 tasks
Merged
19 tasks
bdraco
added a commit
to bdraco/home-assistant
that referenced
this pull request
Jan 17, 2023
19 tasks
balloob
reviewed
Jan 22, 2023
balloob
reviewed
Jan 22, 2023
balloob
approved these changes
Jan 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
bdraco
added a commit
to bdraco/home-assistant
that referenced
this pull request
Jan 22, 2023
…executor related comment home-assistant#85892 (comment)
19 tasks
19 tasks
This was referenced Jan 22, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cla-signed
core
integration: history
noteworthy
Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear)
Quality Scale: internal
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
frontend: home-assistant/frontend#15112
Proposed change
Currently we poll for history data; like logbook we can stream this data to avoid database overhead. This change will allow us to update the frontend places that use cached-history so we can drop it. This change stems from the discussion in home-assistant/frontend#12873 (comment)
This will fix all the dropped states issues we have with cached history since commits are not instant. Currently we assume the data is always there after 1s (default commit interval) but its not always there since the backend API makes no guarantee about when the data will be available (we could be processing stats, or doing a purge, etc) so we tend to drop values which results in lots of unexplained history issues. This implementation can completely replace the cached history used on the frontend and it will never touch the database after the first queries to catch up.
Cc @agners I think this is the last piece we need before we can bump the commit internal to 3s (maybe 5s) and finally realize some more of the IO and flash lifetime savings from your testing
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: