Просмотр исходного кода

Added additional parameters to configure timeseries database queries (kairos_db_sampling_value, kairos_db_start_relative)

pull/194/head
Johannes 7 лет назад
Родитель
Сommit
cdac4bca84
2 измененных файлов: 5 добавлений и 3 удалений
  1. +2
    -2
      modules/logs/endpoints.py
  2. +3
    -1
      update/4_kairosdb_config.sql

+ 2
- 2
modules/logs/endpoints.py Просмотреть файл

@@ -56,7 +56,7 @@ class LogView(FlaskView):
"name": "avg",
"align_sampling": True,
"sampling": {
"value": "5",
"value": cbpi.cache["config"]["kairos_db_sampling_value"].__dict__["value"],
"unit": "seconds"
},
"align_start_time": True
@@ -66,7 +66,7 @@ class LogView(FlaskView):
],
cache_time=0,
start_relative={
"value": "1",
"value": cbpi.cache["config"]["kairos_db_start_relative"].__dict__["value"],
"unit": "days"
})



+ 3
- 1
update/4_kairosdb_config.sql Просмотреть файл

@@ -1,2 +1,4 @@
INSERT OR IGNORE INTO config VALUES ('kairos_db', 'NO', 'select', 'Use timeseries database KairosDB for storing sensor values. You can install KairosDB with the CraftBeerPi installer.', '["YES","NO"]' );
INSERT OR IGNORE INTO config VALUES ('kairos_db_port', 8080, 'number', 'Port for KairosDB. We assume the DB is running on your PI, so IP-Address is 127.0.0.1.', NULL );
INSERT OR IGNORE INTO config VALUES ('kairos_db_port', 8080, 'number', 'Port for KairosDB. We assume the DB is running on your PI, so IP-Address is 127.0.0.1.', NULL );
INSERT OR IGNORE INTO config VALUES ('kairos_db_sampling_value', 5, 'number', 'A timeseries database has the advantage to aggregate data points and therefore to reduce the transmitted data. This value sets a time span in seconds to calculate the average', NULL );
INSERT OR IGNORE INTO config VALUES ('kairos_db_start_relative', 1, 'number', 'If you have an ongoing brew or fermentation process only values related to this process will be shown in the graph. Additionally you can define in days how far the time series should reach in the past. The earliest time of both information defines when the data series starts.', NULL );

Загрузка…
Отмена
Сохранить