MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / rate_per_second

Function rate_per_second

deps/jemalloc/src/stats.c:55–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53/******************************************************************************/
54
55static uint64_t
56rate_per_second(uint64_t value, uint64_t uptime_ns) {
57 uint64_t billion = 1000000000;
58 if (uptime_ns == 0 || value == 0) {
59 return 0;
60 }
61 if (uptime_ns < billion) {
62 return value;
63 } else {
64 uint64_t uptime_s = uptime_ns / billion;
65 return value / uptime_s;
66 }
67}
68
69/* Calculate x.yyy and output a string (takes a fixed sized char array). */
70static bool

Callers 3

stats_arena_bins_printFunction · 0.85
stats_arena_printFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected