Commit Graph

454 Commits (7243f787f97bb6c6d2dece8e751721eba67b1735)

Author SHA1 Message Date
J. Nick Koston 222baa53dd
Make database access in the eventloop raise an exception (#71547) 2022-05-09 15:22:08 -05:00
GitHub Action f1dd3b7f89 [ci skip] Translation update 2022-05-09 00:21:41 +00:00
J. Nick Koston 896bf986eb
Speed up nightly database purges with lambda_stmt (#71537) 2022-05-08 12:47:12 -07:00
J. Nick Koston 6922209ddb
Ensure all mysql tables get optimized (#71538) 2022-05-08 12:15:06 -07:00
J. Nick Koston a8aa0e1cca
Add Estimated Database Size to the recorder system health (#71463) 2022-05-07 21:02:54 -07:00
GitHub Action 44d8f2f773 [ci skip] Translation update 2022-05-07 00:20:47 +00:00
J. Nick Koston d612b9e0b4
Reduce event loop overhead for listeners that already queue (#71364)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-05 23:09:10 -04:00
GitHub Action 07706fa62a [ci skip] Translation update 2022-05-06 00:22:16 +00:00
GitHub Action 2b3fc97020 [ci skip] Translation update 2022-05-05 00:22:23 +00:00
J. Nick Koston eb77f8db85
Complete strict typing for recorder (#71274)
* Complete strict typing for recorder

* update tests

* Update tests/components/recorder/test_migrate.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/recorder/test_migrate.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove the asserts

* remove ignore comments

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-04 12:22:50 -05:00
J. Nick Koston 13ce0a7d6a
Fix history using pre v25 queries during v26 migration (#71295) 2022-05-04 08:56:50 -07:00
J. Nick Koston e30940ef2a
Move processing of recorder service call arguments into services.py (#71260) 2022-05-03 13:56:22 -07:00
J. Nick Koston e1be6dd34f
Move recorder services to services.py (#71249) 2022-05-03 10:38:44 -07:00
J. Nick Koston 29bda196b5
Break apart recorder into tasks and core modules (#71222) 2022-05-02 21:53:56 -07:00
GitHub Action c594de25f7 [ci skip] Translation update 2022-05-03 00:23:56 +00:00
J. Nick Koston 75026f9fed
Separate recorder logic for state_changed and non-state_changed events (#71204) 2022-05-02 17:22:53 -05:00
J. Nick Koston 188040b8bb
Use lambda_stmt for recorder queries and migrate them to queries module (#71219) 2022-05-02 15:17:21 -07:00
J. Nick Koston 5db014666c
Avoid recording state_changed events in the events table (#71165)
* squash

fix mypy

* Update homeassistant/components/recorder/models.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* pass all columns

* fix commented out code

* reduce logbook query complexity

* merge

* comment

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-02 02:10:34 -05:00
J. Nick Koston c23866e5e5
De-duplicate event data into a new event_data table (#71135) 2022-05-01 21:01:17 -05:00
GitHub Action 9b10658d01 [ci skip] Translation update 2022-05-02 00:22:04 +00:00
J. Nick Koston 2d720973ee
Fix incomplete recorder typing (#71158) 2022-05-01 19:53:47 +03:00
GitHub Action ba386b5841 [ci skip] Translation update 2022-05-01 00:28:25 +00:00
J. Nick Koston 66a21e0bc3
Add basic system health data to the recorder (#71086) 2022-04-30 11:10:20 -05:00
J. Nick Koston b9c7a89b47
Prevent sqlalchemy Transparent SQL Compilation Caching from filling up during purge (#71015) 2022-04-28 23:48:28 -07:00
J. Nick Koston 37384f7eb3
Bump sqlalchemy to 1.4.36 (#71039) 2022-04-28 21:32:46 -07:00
Marc Mueller cf90e34776
Type recorder retry decorator (#70993) 2022-04-28 21:04:41 +02:00
J. Nick Koston 27a4a9eed4
Adjust get_latest_short_term_statistics query to be postgresql compatible (#70953) 2022-04-27 21:19:36 -07:00
J. Nick Koston 195811843b
Remove get_state and get_states history api calls (#70830) 2022-04-26 16:05:43 -07:00
J. Nick Koston 6ce768465f
Improve purge performance for non-sqlite databases (#70576) 2022-04-26 13:11:57 -07:00
J. Nick Koston 1c4a785fb3
Prevent autoflush from happening during attrs lookup (#70768) 2022-04-26 13:04:58 -07:00
J. Nick Koston f073f17040
Refactor tracking of the recorder run history (#70456)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-26 09:59:43 -10:00
J. Nick Koston 96d64bd6b7
Avoid selecting last_updated from the db when filtering on last_updated==last_changed (#70459) 2022-04-25 08:46:37 -10:00
J. Nick Koston 9f11063724
Fix state_changes_during_period bakery caching for limit and descending (#70610) 2022-04-24 21:47:21 -07:00
J. Nick Koston 022deb20fd
Fix history not including start time state (#70447) 2022-04-24 14:34:00 -07:00
Dmitry Katsubo 521579fc6a
Fixed syntax error in ALTER TABLE statement (#70304) (#70336) 2022-04-22 21:29:25 -10:00
J. Nick Koston 3737b58e85
Avoid fetching metadata multiple times during stat compile (#70397) 2022-04-22 00:25:42 -10:00
J. Nick Koston 9761a7310e
Adjust doc string for recorder.Recorder.async_periodic_statistics (#70398) 2022-04-21 22:04:42 -07:00
J. Nick Koston 3142a106fc
Additional prep work for sqlalchemy 2.0 (#70358) 2022-04-21 12:39:18 -10:00
Erik Montnemery de9f39745b
Fix race in _process_recorder_platform (#70339)
* Fix race in _process_recorder_platform

* Update homeassistant/components/recorder/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-21 09:03:05 +02:00
J. Nick Koston 37d39ac6d3
Add restored to the set of attributes excluded from being recorded in the db (#70169)
* Add restored to the set of attributes excluded from being recorded in the database

- Noticed on restart that the table gets 100s of new rows because
  of these

* Update homeassistant/components/recorder/const.py
2022-04-16 23:09:08 +02:00
J. Nick Koston 89807f0d2d
Reduce the number of queries needed to compile statistics (#69731)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-15 09:13:29 -07:00
J. Nick Koston c85387290a
Increase recorder queue max backlog to 40k, improve message (#70065) 2022-04-14 11:45:07 -10:00
Marc Mueller e407960f68
Update pylint to 2.13.5 (#69989) 2022-04-13 18:36:05 +02:00
Erik Montnemery ba07663e7d
Fix adjusting statistics in ft³ (#69913)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-12 14:08:38 -07:00
Erik Montnemery eb3458a3d2
Add MutexPool for recorder tests (#69410)
* Add MutexPool for recorder tests

* Fix get_schema_version

* Update test test_last_run_was_recently_clean

* Update test test_shutdown_before_startup_finishes

* Revert comments in test_write_lock_db

* Make the MutexPool lock a class variable

* Remove stale comment

* Move MutexPool

* Tweak debug prints
2022-04-12 07:41:46 -10:00
Erik Montnemery 80ff1ecb2a
Fix adjusting 5-minute statistics (#69921) 2022-04-12 18:10:17 +02:00
J. Nick Koston fe6a4bfb1d
Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
J. Nick Koston 5076437413
Reduce indent in recorder event processing (#69659) 2022-04-07 23:37:20 -10:00
J. Nick Koston 72fffde77a
Fix spelling of periodic in recorder (#69658)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-07 23:37:02 -10:00
J. Nick Koston 66f0a3816a
Reduce memory pressure during database migration (#69628) 2022-04-07 18:29:31 -10:00