소스 검색

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

pull/194/head
Johannes 7 년 전
부모
커밋
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 );

불러오는 중...
취소
저장