From: Remi Gacogne Date: Fri, 11 Dec 2020 16:34:39 +0000 (+0100) Subject: dnsdist: Add a Lua binding for the number of queries dropped by a server X-Git-Tag: rec-4.5.0-alpha1~69^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f4dc573b687f6c040df06f2edb0a2d2a24804e6;p=thirdparty%2Fpdns.git dnsdist: Add a Lua binding for the number of queries dropped by a server --- diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index 50e95bf60a..24a1da3710 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -103,6 +103,7 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) s->pools.erase(pool); }); luaCtx.registerFunction("getOutstanding", [](const DownstreamState& s) { return s.outstanding.load(); }); + luaCtx.registerFunction("getDrops", [](const DownstreamState& s) { return s.reuseds.load(); }); luaCtx.registerFunction("getLatency", [](const DownstreamState& s) { return s.latencyUsec; }); luaCtx.registerFunction("isUp", &DownstreamState::isUp); luaCtx.registerFunction("setDown", &DownstreamState::setDown); diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 973e6c3a4f..6a210d4423 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -603,6 +603,14 @@ A server object returned by :func:`getServer` can be manipulated with these func :returns: A string containing the server name if any plus the server address and port + .. method:: Server:getDrops() -> int + + .. versionadded:: 1.6.0 + + Get the number of dropped queries for this server. + + :returns: The number of outstanding queries + .. method:: Server:getOutstanding() -> int Get the number of outstanding queries for this server.