From: Lukáš Ondráček Date: Wed, 15 Jan 2025 21:25:53 +0000 (+0100) Subject: daemon/defer: add price-factor to verbose log, comment X-Git-Tag: v6.0.10~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbc0cb90339a19933badf4c2df83fc11b04bbf34;p=thirdparty%2Fknot-resolver.git daemon/defer: add price-factor to verbose log, comment --- diff --git a/daemon/defer.c b/daemon/defer.c index 1705ede00..aeaded206 100644 --- a/daemon/defer.c +++ b/daemon/defer.c @@ -299,8 +299,8 @@ void defer_charge(uint64_t nsec, union kr_sockaddr *addr, bool stream) uint8_t prefix; kru_charge_classify(kru_conf, key, prices, &load, &prefix); - VERBOSE_LOG(" %s ADD %4.3f ms -> load: %d on /%d\n", - kr_straddr(&addr->ip), nsec / 1000000.0, load, prefix); + VERBOSE_LOG(" %s ADD %4.3f ms * %.2f -> load: %d on /%d\n", + kr_straddr(&addr->ip), nsec / 1000000.0, pf16 / (float)(1<<16), load, prefix); } /// Determine priority of the request in [0, QUEUES_CNT - 1]; diff --git a/daemon/defer.h b/daemon/defer.h index 0b6fdf51c..e6ade87aa 100644 --- a/daemon/defer.h +++ b/daemon/defer.h @@ -84,6 +84,7 @@ static inline void defer_sample_addr(const union kr_sockaddr *addr, bool stream) } defer_sample_state.stream = stream; defer_sample_state.price_factor16 = 1 << 16; // meaning *1.0, until more information is known + // TODO set to the proper value on each invocation of defer_sample_addr } /// Internal; start accounting work at specified timestamp.