diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2017-11-07 15:09:37 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2017-11-21 12:59:23 +0000 |
commit | 2ccc391e1aa9bd190d1d40dcd1c01cf85fe5a5c6 (patch) | |
tree | f596b2e946fec6f7fe30f3acf60c6fecda86e97a /logd/src/apps | |
parent | 1b245f10e77b4aac6ac0197b1654815ccdc961c7 (diff) |
skeleton for state reporting in logd
* allocate port in config model for logd state reporting
* add state port to logd configuration
* add a state server with no metrics production
Diffstat (limited to 'logd/src/apps')
-rw-r--r-- | logd/src/apps/logd/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/logd/src/apps/logd/main.cpp b/logd/src/apps/logd/main.cpp index 00654060107..70df928dfd2 100644 --- a/logd/src/apps/logd/main.cpp +++ b/logd/src/apps/logd/main.cpp @@ -5,6 +5,7 @@ #include <logd/forward.h> #include <logd/conf.h> #include <logd/watch.h> +#include <logd/state.h> #include <vespa/config/common/exceptions.h> #include <csignal> #include <unistd.h> @@ -29,9 +30,8 @@ int main(int, char**) const char *cfid = getenv("VESPA_CONFIG_ID"); try { - std::unique_ptr<ConfSub> subscriberP; - subscriberP.reset(new ConfSub(fwd, config::ConfigUri(cfid))); - ConfSub & subscriber(*subscriberP); + ConfSub subscriber(fwd, config::ConfigUri(cfid)); + StateReporter stateReporter; int sleepcount = 0; while (true) { @@ -39,6 +39,8 @@ int main(int, char**) try { subscriber.latch(); + stateReporter.setStatePort(subscriber.getStatePort()); + stateReporter.gotConf(subscriber.generation()); int fd = subscriber.getservfd(); if (fd >= 0) { sleepcount = 0 ; // connection OK, reset sleep time |