| 53 | /******************************************************************************/ |
| 54 | |
| 55 | static uint64_t |
| 56 | rate_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). */ |
| 70 | static bool |
no outgoing calls
no test coverage detected