Skip to content

Commit

Permalink
fix prometheus config parser
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed May 16, 2024
1 parent b7d679d commit 63dc7dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ static config::decimate_or_stream get_decimate_or_stream(const config::SpectrumS

template <> struct from<std::unique_ptr<config::Prometheus>> {
static auto from_toml(const value& v) -> std::unique_ptr<config::Prometheus> {
const std::string prometheus_host = find_or(v, "PrometheusHost", config::kDefaultPrometheusHost);
const uint16_t prometheus_port = find_or(v, "PrometheusPort", config::kDefaultPrometheusPort);
const std::string prometheus_host = find_or(v, "Host", config::kDefaultPrometheusHost);
const uint16_t prometheus_port = find_or(v, "Port", config::kDefaultPrometheusPort);

return std::make_unique<config::Prometheus>(prometheus_host, prometheus_port);
}
Expand Down
4 changes: 1 addition & 3 deletions test/config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ TEST(config, TopLevel_prometheus_set) {
CenterFrequency = 4000000
DeviceString = "device_string_abc"
SampleRate = 60000
[Prometheus]
Host = "127.0.0.2"
Port = 4200
Expand All @@ -132,8 +132,6 @@ TEST(config, TopLevel_prometheus_set) {
EXPECT_EQ(t.prometheus_->port_, 4200);
}

TEST(config, TopLevel_valid_parser) {
const toml::value config_object = u8R"(
TEST(config, TopLevel_valid_parser) {
const toml::value config_object = u8R"(
CenterFrequency = 4000000
Expand Down

0 comments on commit 63dc7dc

Please sign in to comment.