MCPcopy Create free account
hub / github.com/ElementsProject/lightning / usec_over_budget

Function usec_over_budget

connectd/multiplex.c:651–656  ·  view source on GitHub ↗

usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth * of quota burned in one go." */

Source from the content-addressed store, hash-verified

649/* usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth
650 * of quota burned in one go." */
651static u64 usec_over_budget(u64 usage, u64 limit)
652{
653 if (limit == 0)
654 return 0;
655 return usage * (u64)1000000 / limit;
656}
657
658/* Checks two (usage, limit) pairs (e.g. bytes and CPU usec): if
659 * neither is over, returns 0. Otherwise logs it (once) and returns

Callers 1

maybe_throttle_usecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected