Beispiel #1
0
def test_load_config_influxdb(config_dir):
    config: RecorderConfiguration = load_config(config_dir / "influxdb.ini")

    assert isinstance(config.influxdb, InfluxDBConfiguration)
    assert config.influxdb.host
    assert config.influxdb.token
    assert config.influxdb.bucket
    assert config.influxdb.org
Beispiel #2
0
def test_load_config_missing(config_dir):
    config: RecorderConfiguration = load_config(".")
    assert isinstance(config, RecorderConfiguration)
    assert not config.kafka
    assert not config.influxdb
Beispiel #3
0
def test_load_config_empty(config_dir):
    config: RecorderConfiguration = load_config(config_dir / "empty.ini")
    assert isinstance(config, RecorderConfiguration)
    assert not config.kafka
    assert not config.influxdb
Beispiel #4
0
def test_load_config_kafka(config_dir):
    config: RecorderConfiguration = load_config(config_dir / "kafka.ini")

    assert isinstance(config.kafka, KafkaConfiguration)
    assert config.kafka.bootstrap_servers
Beispiel #5
0
def run(port: int = 20777):
    config = load_config()
    recorder = DataRecorder(config, port=port)
    recorder.listen()