From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 31 Jan 2023 16:07:50 +0000 (-0500) Subject: Replace `usec` with `us` X-Git-Tag: rec-4.9.0-alpha1~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35f4f57433255aa364acbdfb60b36f2776bb741a;p=thirdparty%2Fpdns.git Replace `usec` with `us` - Swap `total [unit]` to `[unit] total` - Mostly remove leading space before `us` - `took` lines excluded - lines with other units that still had leading spaces excluded --- diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index db8e6c2f32..04518bb5ce 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -262,7 +262,7 @@ public: } if (d_dolog) - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " usec to execute" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us to execute" << endl; return this; } @@ -270,7 +270,7 @@ public: bool hasNextRow() { if (d_dolog && d_residx == d_resnum) { - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " total usec to last row" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us total to last row" << endl; } return d_residx < d_resnum; } diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index 9b19b0ce2a..f373c8adf7 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -112,7 +112,7 @@ public: d_cur_set = 0; if (d_dolog) { auto diff = d_dtime.udiffNoReset(); - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << diff << " usec to execute" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << diff << " us to execute" << endl; } nextResult(); @@ -143,7 +143,7 @@ public: bool hasNextRow() { if (d_dolog && d_residx == d_resnum) { - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiff() << " total usec to last row" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiff() << " us total to last row" << endl; } return d_residx < d_resnum; diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 086200f50b..2518f2bdf0 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -813,13 +813,13 @@ void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId, if (d_getcursor->lower_bound(d_matchkey, key, val) || key.get().rfind(d_matchkey, 0) != 0) { d_getcursor.reset(); if (d_dolog) { - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " usec to execute (found nothing)" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us to execute (found nothing)" << endl; } return; } if (d_dolog) { - g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " usec to execute" << endl; + g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us to execute" << endl; } d_lookupdomain = hunt; diff --git a/pdns/dnsdist-carbon.cc b/pdns/dnsdist-carbon.cc index b953180180..0fc8674839 100644 --- a/pdns/dnsdist-carbon.cc +++ b/pdns/dnsdist-carbon.cc @@ -281,7 +281,7 @@ static void carbonHandler(Carbon::Endpoint&& endpoint) usleep(toSleepUSec); } else { - vinfolog("Carbon export for %s took longer (%s usec) than the configured interval (%d usec)", endpoint.server.toStringWithPort(), elapsedUSec, intervalUSec); + vinfolog("Carbon export for %s took longer (%s us) than the configured interval (%d us)", endpoint.server.toStringWithPort(), elapsedUSec, intervalUSec); } consecutiveFailures = 0; } diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 7100cf72be..347b617072 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -468,7 +468,7 @@ void setupLuaRules(LuaContext& luaCtx) } } double udiff = sw.udiff(); - g_outputBuffer=(boost::format("Had %d matches out of %d, %.1f qps, in %.1f usec\n") % matches % times % (1000000*(1.0*times/udiff)) % udiff).str(); + g_outputBuffer=(boost::format("Had %d matches out of %d, %.1f qps, in %.1f us\n") % matches % times % (1000000*(1.0*times/udiff)) % udiff).str(); }); diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 11da401daf..7c714c1e20 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -241,7 +241,7 @@ static void handleResponseSent(std::shared_ptr& stat if (currentResponse.d_idstate.selfGenerated == false && ds) { const auto& ids = currentResponse.d_idstate; double udiff = ids.queryRealTime.udiff(); - vinfolog("Got answer from %s, relayed to %s (%s, %d bytes), took %f usec", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), (state->d_handler.isTLS() ? "DoT" : "TCP"), currentResponse.d_buffer.size(), udiff); + vinfolog("Got answer from %s, relayed to %s (%s, %d bytes), took %f us", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), (state->d_handler.isTLS() ? "DoT" : "TCP"), currentResponse.d_buffer.size(), udiff); auto backendProtocol = ds->getProtocol(); if (backendProtocol == dnsdist::Protocol::DoUDP) { diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 6dddd4fd50..b443ff1f0c 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -696,10 +696,10 @@ static void handleResponseForUDPClient(InternalQueryState& ids, PacketBuffer& re if (!selfGenerated) { double udiff = ids.queryRealTime.udiff(); if (!muted) { - vinfolog("Got answer from %s, relayed to %s (UDP), took %f usec", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff); + vinfolog("Got answer from %s, relayed to %s (UDP), took %f us", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff); } else { - vinfolog("Got answer from %s, NOT relayed to %s (UDP) since that frontend is muted, took %f usec", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff); + vinfolog("Got answer from %s, NOT relayed to %s (UDP) since that frontend is muted, took %f us", ds->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff); } handleResponseSent(ids, udiff, dr.ids.origRemote, ds->d_config.remote, response.size(), cleartextDH, ds->getProtocol(), true); diff --git a/pdns/dnsdistdist/doh.cc b/pdns/dnsdistdist/doh.cc index 8481193d87..021eec32d2 100644 --- a/pdns/dnsdistdist/doh.cc +++ b/pdns/dnsdistdist/doh.cc @@ -486,7 +486,7 @@ public: if (!du->ids.selfGenerated) { double udiff = du->ids.queryRealTime.udiff(); - vinfolog("Got answer from %s, relayed to %s (https), took %f usec", du->downstream->d_config.remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff); + vinfolog("Got answer from %s, relayed to %s (https), took %f us", du->downstream->d_config.remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff); auto backendProtocol = du->downstream->getProtocol(); if (backendProtocol == dnsdist::Protocol::DoUDP && du->tcp) { @@ -1735,7 +1735,7 @@ void handleUDPResponseForDoH(DOHUnitUniquePtr&& du, PacketBuffer&& udpResponse, du = std::move(dr.ids.du); double udiff = du->ids.queryRealTime.udiff(); - vinfolog("Got answer from %s, relayed to %s (https), took %f usec", du->downstream->d_config.remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff); + vinfolog("Got answer from %s, relayed to %s (https), took %f us", du->downstream->d_config.remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff); handleResponseSent(du->ids, udiff, dr.ids.origRemote, du->downstream->d_config.remote, du->response.size(), cleartextDH, du->downstream->getProtocol(), true); diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index 62181dabfb..8c0c32c2c0 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -478,7 +478,7 @@ try perc=sum*100.0/totpairs; if(j->first < 1024) - cout<< perc <<"% of questions answered within " << j->first << " usec ("; + cout<< perc <<"% of questions answered within " << j->first << " us ("; else cout<< perc <<"% of questions answered within " << j->first/1000.0 << " ms ("; @@ -494,7 +494,7 @@ try if(!j->second) { perc=sum*100.0/totpairs; if(j->first < 1024) - cout<< perc <<"% of questions answered within " << j->first << " usec ("; + cout<< perc <<"% of questions answered within " << j->first << " us ("; else cout<< perc <<"% of questions answered within " << j->first/1000.0 << " ms ("; @@ -507,7 +507,7 @@ try cout<< (totpairs-lastsum)<<" responses ("<<((totpairs-lastsum)*100.0/answers) <<"%) older than "<< (done.rbegin()->first/1000000.0) <<" seconds"<().empty()) { ofstream load(g_vm["load-stats"].as().c_str()); diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 50479d5ee7..49b8c9a880 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -375,7 +375,7 @@ void DNSCryptoKeyEngine::testMakers(unsigned int algo, maker_t* creator, maker_t if(verified) { udiffVerify = dt.udiff() / 100; - cout<<"Signature & verify ok, create "<getName()+" with signer "+dckeSign->getName()+" and verifier "+dckeVerify->getName()+" failed"); diff --git a/pdns/dnstcpbench.cc b/pdns/dnstcpbench.cc index d092a6a9d1..b35ebc7a96 100644 --- a/pdns/dnstcpbench.cc +++ b/pdns/dnstcpbench.cc @@ -305,8 +305,8 @@ try } cout<<"Average qps: "< void doRun(const C& cmd, int mseconds=100) cmd(); } double delta=dt.ndiff()/1000000000.0; - boost::format fmt("'%s' %.02f seconds: %.1f runs/s, %.02f usec/run"); + boost::format fmt("'%s' %.02f seconds: %.1f runs/s, %.02f us/run"); cerr<< (fmt % cmd.getName() % delta % (runs/delta) % (delta* 1000000.0/runs)) << endl; g_totalRuns += runs; diff --git a/pdns/ssqlite3.cc b/pdns/ssqlite3.cc index c2c96ebea7..85efc19065 100644 --- a/pdns/ssqlite3.cc +++ b/pdns/ssqlite3.cc @@ -97,12 +97,12 @@ public: throw SSqlException(string("Error while retrieving SQLite query results: ")+SSQLite3ErrorString(d_db->db())); } if(d_dolog) - g_log<