changeset 1869:02390829df1a

mod_log_mark: Module that sends a line to the log once per minute
author Kim Alvefur <zash@zash.se>
date Tue, 22 Sep 2015 17:55:22 +0200
parents d6e673f98572
children 6a9f91ad4f95
files mod_log_mark/README.markdown mod_log_mark/mod_log_mark.lua
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_log_mark/README.markdown	Tue Sep 22 17:55:22 2015 +0200
@@ -0,0 +1,7 @@
+---
+summary: Log a message once per minute
+...
+
+This module sends `-- MARK --` to the log once per minute. This may be
+useful to give a sense of how busy the server is or see that timers are
+still working.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_log_mark/mod_log_mark.lua	Tue Sep 22 17:55:22 2015 +0200
@@ -0,0 +1,6 @@
+local log = _G.log;
+
+module:add_timer(60-os.date("%S"), function ()
+	log("info", "-- MARK --");
+	return 60;
+end);