From: Remi Gacogne Date: Tue, 27 Mar 2018 09:05:25 +0000 (+0200) Subject: dnsdist: Use double instead of int in the API X-Git-Tag: dnsdist-1.3.0~23^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=778fe0a86d5468c05d02d823c2a43fd588d1b2ee;p=pdns dnsdist: Use double instead of int in the API --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 76977946a..8cee0f379 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -314,7 +314,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str else if (const auto& dval = boost::get(&e.second)) obj.insert({e.first, (**dval)}); else - obj.insert({e.first, (int)(*boost::get(&e.second))(e.first)}); + obj.insert({e.first, (double)(*boost::get(&e.second))(e.first)}); } Json my_json = obj; resp.body=my_json.dump(); @@ -405,16 +405,16 @@ static void connectionThread(int sock, ComboAddress remote, string password, str {"name", a->name}, {"address", a->remote.toStringWithPort()}, {"state", status}, - {"qps", (int)a->queryLoad}, - {"qpsLimit", (int)a->qps.getRate()}, - {"outstanding", (int)a->outstanding}, - {"reuseds", (int)a->reuseds}, - {"weight", (int)a->weight}, - {"order", (int)a->order}, + {"qps", (double)a->queryLoad}, + {"qpsLimit", (double)a->qps.getRate()}, + {"outstanding", (double)a->outstanding}, + {"reuseds", (double)a->reuseds}, + {"weight", (double)a->weight}, + {"order", (double)a->order}, {"pools", pools}, - {"latency", (int)(a->latencyUsec/1000.0)}, + {"latency", (double)(a->latencyUsec/1000.0)}, {"queries", (double)a->queries}, - {"sendErrors", (int)a->sendErrors} + {"sendErrors", (double)a->sendErrors} }; /* sending a latency for a DOWN server doesn't make sense */ @@ -448,7 +448,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str Json::object entry { { "id", num++ }, { "name", pool.first }, - { "serversCount", (int) pool.second->countServers(false) }, + { "serversCount", (double) pool.second->countServers(false) }, { "cacheSize", (double) (cache ? cache->getMaxEntries() : 0) }, { "cacheEntries", (double) (cache ? cache->getEntriesCount() : 0) }, { "cacheHits", (double) (cache ? cache->getHits() : 0) }, @@ -536,7 +536,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str doc.push_back(Json::object { { "type", "StatisticItem" }, { "name", item.first }, - { "value", (int)(*boost::get(&item.second))(item.first) } + { "value", (double)(*boost::get(&item.second))(item.first) } }); } }