diff options
author | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2016-07-12 21:16:06 +0200 |
---|---|---|
committer | Vegard Sjonfjell <vegardsjo@gmail.com> | 2016-07-12 21:16:06 +0200 |
commit | fc7a2cdb64ca870cf00fa2d7dc723d91f56e5561 (patch) | |
tree | 3924b7e47689cf9c7936d0f3e84b20ca4517955a /configutil/src/lib/configstatus.cpp | |
parent | 99de121a82da5b20ef5b8324706f272973879b9b (diff) |
Add host filtering option to config status util (#350)
* Let vespa-config-status take in an optional host filter set
If the argument is not specified, services on all hosts in the model
will be queried as before. Iff the filter argument is specified, only
services on the hosts explicitly given will be queried.
* Make variable name easier on the eyes
Diffstat (limited to 'configutil/src/lib/configstatus.cpp')
-rw-r--r-- | configutil/src/lib/configstatus.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/configutil/src/lib/configstatus.cpp b/configutil/src/lib/configstatus.cpp index f889c436a97..76a1faec625 100644 --- a/configutil/src/lib/configstatus.cpp +++ b/configutil/src/lib/configstatus.cpp @@ -139,10 +139,14 @@ ConfigStatus::action() for (size_t i = 0; i < _cfg->hosts.size(); i++) { const cloud::config::ModelConfig::Hosts &hconf = _cfg->hosts[i]; + // TODO PERF: don't fetch entire model when we're only looking for + // a subset of hosts. + if (!_flags.host_filter.includes(hconf.name)) { + continue; + } for (size_t j = 0; j < hconf.services.size(); j++) { const cloud::config::ModelConfig::Hosts::Services &svc = hconf.services[j]; - if (svc.type == "configserver") { continue; } |