return dnsQuestion.ids.queryRealTime.getStartTime();
});
+ luaCtx.registerFunction<double (DNSQuestion::*)() const>("getElapsedUs", [](const DNSQuestion& dnsQuestion) {
+ return dnsQuestion.ids.queryRealTime.udiff();
+ });
+
luaCtx.registerFunction<void (DNSQuestion::*)(std::string)>("sendTrap", [](const DNSQuestion& dnsQuestion, boost::optional<std::string> reason) {
#ifdef HAVE_NET_SNMP
if (g_snmpAgent != nullptr && dnsdist::configuration::getCurrentRuntimeConfiguration().d_snmpTrapsEnabled) {
return dnsResponse.ids.queryRealTime.getStartTime();
});
+ luaCtx.registerFunction<double (DNSResponse::*)() const>("getElapsedUs", [](const DNSResponse& dnsResponse) {
+ return dnsResponse.ids.queryRealTime.udiff();
+ });
+
luaCtx.registerFunction<void (DNSResponse::*)(std::string)>("sendTrap", [](const DNSResponse& dnsResponse, boost::optional<std::string> reason) {
#ifdef HAVE_NET_SNMP
if (g_snmpAgent != nullptr && dnsdist::configuration::getCurrentRuntimeConfiguration().d_snmpTrapsEnabled) {
:returns: A table of EDNSOptionView objects, indexed on the ECS Option code
+ .. method:: DNSQuestion::getElapsedUs -> double
+
+ .. versionadded:: 2.0.0
+
+ Return the amount of time that has elapsed since the query was received.
+
+ :returns: A double indicating elapsed time in microseconds
+
.. method:: DNSQuestion:getHTTPHeaders() -> table
.. versionadded:: 1.4.0