This exposes the total number of queries a downstream server has handled
similarly to how the :getDrops() method are available within Lua
When doing custom logic within Lua it's sometimes useful to be able to
know how many queries a given server has handled, so this simply exposes
that metric within the Server class directly.
});
luaCtx.registerFunction<uint64_t (DownstreamState::*)() const>("getOutstanding", [](const DownstreamState& state) { return state.outstanding.load(); });
luaCtx.registerFunction<uint64_t (DownstreamState::*)() const>("getDrops", [](const DownstreamState& state) { return state.reuseds.load(); });
+ luaCtx.registerFunction<uint64_t (DownstreamState::*)() const>("getQueries", [](const DownstreamState& state) { return state.queries.load(); });
luaCtx.registerFunction<double (DownstreamState::*)() const>("getLatency", [](const DownstreamState& state) { return state.getRelevantLatencyUsec(); });
luaCtx.registerFunction("isUp", &DownstreamState::isUp);
luaCtx.registerFunction("setDown", &DownstreamState::setDown);
:returns: The number of dropped queries
+ .. method:: Server:getQueries() -> int
+
+ .. versionadded:: 2.0.x
+
+ Get the number of total queries for this server.
+
+ :returns: The number of dropped queries
+
.. method:: Server:getHealthCheckMode() -> str
.. versionadded:: 2.0.0