58 Commits

Author SHA1 Message Date
Jenkins nymea
56517ce491 Merge PR #241: Improve log DB housekeeping performance 2020-01-29 21:44:34 +01:00
Jenkins nymea
44a403f0e4 Merge PR #238: Add System Time API 2020-01-29 21:44:34 +01:00
Michael Zanetti
03c8e8d114 Improve log DB housekeeping performance
Getting row count on a db with approx 200000 entries on an RPi takes
about 500ms. To avoid this, this branch keeps better track of entries
in the DB and only queries DB count if we can't calculate it ourselves.
Trimming itself takes some 150ms. To reduce those calls it changes the
threshold of when to trim the DB from a fixed value of 100 to 1% of
maxDBSize.

Last but not least, getLogEntry() calls are now prioritized over
appendLogEntry() calls in order to stay responsive to client apps even
if the DB is overloaded with a huge job queue.

If the job queue grows to over 1000 jobs, logs of the same device/type
will be discared to avoid log flooding.
2020-01-05 23:46:51 +01:00
Michael Zanetti
9b07216768 Add system api to configure the system time
This gets rid of the locally kept time zone which caused issues
in plugins and the ScriptEngine.
2019-12-15 12:44:14 +01:00
Michael Zanetti
24cecf9d47 Add tests for the scriptengine 2019-12-10 18:49:28 +01:00
Michael Zanetti
3a9a0a0abc Add scripts api namespace 2019-12-01 00:08:57 +01:00
Michael Zanetti
d4081195d4 Some more work on the script engine 2019-12-01 00:07:35 +01:00
Michael Zanetti
4c0c95b1a8 Add a ScriptEngine 2019-12-01 00:07:35 +01:00
Michael Zanetti
c7dd26d525 cleanup, fix last tests 2019-11-16 00:44:08 +01:00
Michael Zanetti
3eac06de6e Threaded log database
This
a) makes the log db threaded by using QtConcurrent to run queries in a
different thread but still keeps ordering of the queries and always
only allows a single query at a time (QSql is not threadsafe). This fixes
removeDevice calls failing if we take more than $jsonprc_timeout to clean
a deleted device from the DB and keeps nymead responsive during that too.

b) generally improces performance of the system by not requiring operations
(emitting events, changing states) to wait for the sync log db entry to be
made.

c) drops some of the houskeeping code on nymea startup. While this will still
do log db housekeeping if the DB exceeds maxDbSize, it will not run
housekeeping on the DB any more at application startup. Reasoning for this
is that there have been reports of rules/log entries beimg destroyed if a
plugin can't be found at application startup. Given our general direction
of working towards more dynamic plugin loading, this might happen more often
in the future and we sure don't want to destroy rules etc when we just
temporarily miss a plugin.

d) tries to fix issue #226 by rotating the DB not only when it fails to open
initially, but also when it fails to insert new entries.
2019-11-15 18:33:10 +01:00
Michael Zanetti
ec15e664e1 cleanup warnings and allow setting "unknown" debug categories 2019-11-06 13:38:22 +01:00
Michael Zanetti
baaa719b6a Restructuring json done 2019-11-01 20:55:45 +01:00
Michael Zanetti
e2cf9cb5c3 More work on the experience mode framework 2019-11-01 20:55:45 +01:00
Michael Zanetti
fab1871ea1 loading plugins working 2019-11-01 20:53:41 +01:00
Michael Zanetti
a47bded031 add loading of plugins 2019-11-01 20:53:41 +01:00
Michael Zanetti
f1ca2a5b86 Add experience mode plugins 2019-11-01 20:46:55 +01:00
Michael Zanetti
03b8be22d6 Drop old REST server 2019-11-01 20:14:00 +01:00
Jenkins nymea
d589b66e3c Merge PR #218: Improve live logs in debug interface and rework logging rules 2019-10-18 14:57:23 +02:00
Michael Zanetti
7f0f2d1d09 Rework devicemanager and plugin api 2019-10-16 17:56:49 +02:00
Simon Stürz
b4f32c073a Add dynamic logging filter elements for core and plugins in the livelog view 2019-10-08 16:19:42 +02:00
Michael Zanetti
b4ae1919ba cleanup fixes 2019-07-25 15:56:18 +02:00
Michael Zanetti
0fb42681af A little more work on browser item support for rules 2019-07-25 15:56:18 +02:00
Michael Zanetti
aee554a1ee BrowserItemActions, yay! 2019-07-25 15:56:18 +02:00
Michael Zanetti
ff337bf8b6 Make browser item execution work async too 2019-07-25 15:56:18 +02:00
Michael Zanetti
d24abfe3d0 Move devicemanager's implementation out of libnymea into libnymea-core 2019-07-15 22:52:52 +02:00
Michael Zanetti
77a3e851bd Add support for device settings 2019-07-04 13:33:50 +02:00
Michael Zanetti
253972cb9a Abstract ZeroConf into a platform plugin 2019-05-23 05:35:03 +02:00
Michael Zanetti
02b97a686e Simplify it a bit 2019-05-10 01:31:26 +02:00
Michael Zanetti
3944e94699 Initial work on an integrated system update mechanism 2019-05-02 12:14:16 +02:00
Michael Zanetti
9ff834b7ff Do a more controlled teardown on shutdown 2019-04-16 23:44:06 +02:00
Jenkins
d510aa13bb Merge PR #148: Add support for state based rule action parameters 2019-04-12 13:42:30 +02:00
Jenkins
c442eb3592 Merge PR #142: Fix TimeDescriptors getting lost when updating a rule 2019-04-12 13:42:30 +02:00
Michael Zanetti
6afe3e5161 fixup api 2019-04-10 13:40:16 +02:00
Michael Zanetti
774452ff7c Add support for state based rule action params 2019-04-10 13:40:16 +02:00
Michael Zanetti
4275f9052f Fix TimeDescriptors getting lost when updating a rule by removing a device 2019-04-08 17:01:38 +02:00
Michael Zanetti
8ebd1ddc4e Rework translation mechanism
This branch moves the translation logic out of the DevicePlugin
into the JsonRpc layers (JsonRpcHandlers and Rest handlers) and
deprecates the Configuration.SetLanguage method call. Instead
it adds a "locale" property in the JSONRPC.Hello message. This
will allow multiple clients to connect to a single core using
different languages.
2019-04-08 16:49:24 +02:00
Michael Zanetti
81e4db3a90 Handle binding loops in rules properly 2019-04-08 13:55:15 +02:00
Michael Zanetti
c6d9bdd75c Make loading and tearing down of the core more predictable 2019-04-08 13:55:15 +02:00
Michael Zanetti
15938cafb3 Fix an issue where Rules might not be initialized properly at startup 2019-04-08 13:55:15 +02:00
Michael Zanetti
e1affe17d0 fix init order 2019-04-08 13:55:15 +02:00
Michael Zanetti
5847d6831d add support for an MQTT hardware resource 2019-04-08 13:55:15 +02:00
Michael Zanetti
a29a0483b2 add api to deploy certificates 2019-04-08 13:55:15 +02:00
Michael Zanetti
c5f4c9dc51 an initial take on a alternative remote connection 2019-04-08 13:55:15 +02:00
Simon Stürz
dcd410457d Update core documentation and fix inline warnings 2019-04-08 13:55:15 +02:00
Michael Zanetti
681b306b1b fix rules with time descriptors to follow the same logic 2019-04-08 13:55:15 +02:00
Michael Zanetti
157b0b2b2c use exitActions for else-action in event based rules 2019-04-08 13:55:15 +02:00
Michael Zanetti
a6f4ddf188 Implement a tagging system 2019-04-08 13:55:15 +02:00
Simon Stürz
844f7a53a8 Add user database rotation if the database is broken. 2019-04-08 13:55:15 +02:00
Michael Zanetti
11d56d1020 allow passing params if QVariant can convert them 2019-04-08 13:55:15 +02:00
Michael Zanetti
8db7e050db Add support for configuring the used database backend 2019-04-08 13:55:15 +02:00