Software /
code /
prosody
Diff
plugins/mod_http_file_share.lua @ 11802:3d411720e719
mod_http_file_share: Fix measuring how long periodic task take
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 14 Sep 2021 15:33:39 +0200 |
parent | 11794:5d925f340ae6 |
child | 11853:ae5ac9830add |
line wrap: on
line diff
--- a/plugins/mod_http_file_share.lua Tue Sep 14 14:19:05 2021 +0200 +++ b/plugins/mod_http_file_share.lua Tue Sep 14 15:33:39 2021 +0200 @@ -448,8 +448,10 @@ wait(); end + local prune_start = module:measure("prune", "times"); + local reaper_task = async.runner(function(boundary_time) - local prune_done = module:measure("prune", "times"); + local prune_done = prune_start(); local iter, total = assert(uploads:find(nil, {["end"] = boundary_time; total = true})); if total == 0 then @@ -534,8 +536,10 @@ if total_storage_limit then local async = require "util.async"; + local summary_start = module:measure("summary", "times"); + local summarizer_task = async.runner(function() - local summary_done = module:measure("summary", "times"); + local summary_done = summary_start(); local iter = assert(uploads:find(nil)); local count, sum = 0, 0;