Software / code / prosody
Comparison
util/statistics.lua @ 7988:dc758422d896
util.statistics,statsd,throttle,timer: Replace dependency on LuaSockect with util.time for precision time
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 20 Mar 2017 00:48:28 +0100 |
| parent | 6649:99fa40d498cc |
| child | 10314:bbc879eab1bf |
comparison
equal
deleted
inserted
replaced
| 7987:b3ee697158b5 | 7988:dc758422d896 |
|---|---|
| 1 local t_sort = table.sort | 1 local t_sort = table.sort |
| 2 local m_floor = math.floor; | 2 local m_floor = math.floor; |
| 3 local time = require "socket".gettime; | 3 local time = require "util.time".now; |
| 4 | 4 |
| 5 local function nop_function() end | 5 local function nop_function() end |
| 6 | 6 |
| 7 local function percentile(arr, length, pc) | 7 local function percentile(arr, length, pc) |
| 8 local n = pc/100 * (length + 1); | 8 local n = pc/100 * (length + 1); |