view mod_statistics_cputotal/mod_statistics_cputotal.lua @ 3952:343dc9dd70dd

mod_prometheus: Ensure mod_http is loaded where the http interface is exposed (thanks Martin) Loading mod_http globally does not have the desired effect, it needs to be loaded in the host context where module:provides is called.
author Kim Alvefur <zash@zash.se>
date Sat, 21 Mar 2020 18:05:22 +0100
parents 4557ac5c205d
children
line wrap: on
line source

-- Provides total CPU time, useful for DERIVE

module:set_global();

module:provides("statistics", {
	statistics = {
		cpu_total = { -- milliseconds of CPU time used
			get = function()
				return os.clock() * 1000;
			end
		}
	}
});