Software / code / prosody-modules
File
mod_benchmark_storage/mod_benchmark_storage.lua @ 6302:06fbbd45ba75
mod_cloud_notify: Readme: fix links and labels that were removed in the last commit
diff --git a/mod_cloud_notify/README.md b/mod_cloud_notify/README.md
--- a/mod_cloud_notify/README.md
+++ b/mod_cloud_notify/README.md
@@ -1,3 +1,9 @@
+----
+-labels:
+-- 'Stage-Beta'
+-summary: 'XEP-0357: Cloud push notifications'
+----
+
# Introduction
This module enables support for sending "push notifications" to clients
@@ -32,15 +38,15 @@ notification to your device. When your d
it will display it or wake up the app so it can connect to XMPP and
receive any pending messages.
-This protocol is described for developers in \[XEP-0357: Push
-Notifications\].
+This protocol is described for developers in [XEP-0357: Push
+Notifications].
-For this module to work reliably, you must have \[mod_smacks\],
-\[mod_mam\] and \[mod_carbons\] also enabled on your server.
+For this module to work reliably, you must have [mod_smacks],
+[mod_mam] and [mod_carbons] also enabled on your server.
Some clients, notably Siskin and Snikket iOS need some additional
extensions that are not currently defined in a standard XEP. To support
-these clients, see \[mod_cloud_notify_extensions\].
+these clients, see [mod_cloud_notify_extensions].
# Configuration
@@ -58,18 +64,18 @@ these clients, see \[mod_cloud_notify_ex
# Internal design notes
App servers are notified about offline messages, messages stored by
-\[mod_mam\] or messages waiting in the smacks queue. The business rules
+[mod_mam] or messages waiting in the smacks queue. The business rules
outlined
[here](//mail.jabber.org/pipermail/standards/2016-February/030925.html)
are all honored[^2].
-To cooperate with \[mod_smacks\] this module consumes some events:
+To cooperate with [mod_smacks] this module consumes some events:
`smacks-ack-delayed`, `smacks-hibernation-start` and
`smacks-hibernation-end`. These events allow this module to send out
notifications for messages received while the session is hibernated by
-\[mod_smacks\] or even when smacks acknowledgements for messages are
+[mod_smacks] or even when smacks acknowledgements for messages are
delayed by a certain amount of seconds configurable with the
-\[mod_smacks\] setting `smacks_max_ack_delay`.
+[mod_smacks] setting `smacks_max_ack_delay`.
The `smacks_max_ack_delay` setting allows to send out notifications to
clients which aren't already in smacks hibernation state (because the
| author | Menel <menel@snikket.de> |
|---|---|
| date | Fri, 13 Jun 2025 10:44:37 +0200 |
| parent | 2195:967ba20e1202 |
line wrap: on
line source
-- mod_benchmark_storage -- Copyright (C) 2015 Kim Alvefur -- -- Prime numbers are pretty cool local gettime = require"socket".gettime; local sm = require"core.storagemanager"; local um = require"core.usermanager"; local mm = require"core.modulemanager"; local test_data, test_users; function module.command(arg) local test_driver = arg[1]; if not test_driver then return print("Usage: prosodyctl mod_"..module.name.." <storage driver>"); end local hostname = "benchmark.invalid"; prosody.hosts[hostname] = { type = "local", events = prosody.events, modules = {}, sessions = {}, users = require "core.usermanager".new_null_provider(hostname) }; sm.initialize_host(hostname); um.initialize_host(hostname); local start_time = gettime(); local storage = assert(sm.load_driver(hostname, test_driver)); storage = assert(storage:open("benchmark")); -- for i = 1, 23 do -- storage:set(test_users[i], test_data); -- end local floor, sin, random, pi = math.floor, math.sin, math.random, math.pi; for i = 1, 10079 do if i % 11 == 1 then storage:set(test_users[i%23+1], test_data[3-floor(sin(random()*pi)*3)]); else storage:get(test_users[i%23+1]); end if i % 151 == 0 then -- Give indication of progress io.write("*"); io.flush(); end end -- Cleanup for i = 1, 23 do storage:set(test_users[i], nil); end mm.unload(hostname, "storage_"..test_driver); local time_taken = gettime() - start_time; io.write("\27[0G\27[K"); -- Clear current line io.flush(); print(("Took %fs with mod_storage_%s"):format(time_taken, test_driver)); end -- 23 usernames test_users = { "tritonymph"; "ankylotomy"; "tron"; "barbaric"; "twiddler"; "spiritful"; "unmollifiably"; "suggestion"; "presubsistence"; "unneeded"; "taxemic"; "teloteropathic"; "nonbending"; "mev"; "septifragally"; "clame"; "obsolescent"; "unconceivable"; "foolishly"; "conjunctur"; "precirculation"; "bethump"; "vermivorous"; }; test_data = { { some_data = "tiny data" }; -- { [false] = { version = 1; pending = {}; }; -- Medium data ["user@example.com"] = { subscription = "both"; groups = {}; name = "My Best Friend"; }; }; -- { attr = { xmlns = "vcard-temp"; }; name = "vCard"; -- The largest data { attr = { xmlns = "vcard-temp"; }; name = "NICKNAME"; "Buster"; }; { attr = { xmlns = "vcard-temp"; }; name = "PHOTO"; { attr = { xmlns = "vcard-temp"; }; name = "TYPE"; "image/jpeg"; }; { attr = { xmlns = "vcard-temp"; }; name = "BINVAL"; [[ /9j/4AAQSkZJRgABAgAAZABkAAD/2wBDAAgFBQUGBQgGBggLBwYHCw0JCAgJDQ8MDA0MDA8RDAwM DAwMEQ4RERIREQ4XFxgYFxcgICAgICQkJCQkJCQkJCT/2wBDAQgICA8ODxwTExwfGRQZHyQkJCQk JCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCT/wAARCAA8ADwDAREA AhEBAxEB/8QAGwAAAgMBAQEAAAAAAAAAAAAABgcDBAUCCAH/xAA9EAACAQIEAgcECAMJAAAAAAAB AgMEEQAFEhMGIQcUFSIxQWEWQlFSIyQyM2JxgZElcqEXJjSCksHR8PH/xAAbAQACAwEBAQAAAAAA AAAAAAAEBQECAwYAB//EADcRAAEDAwIDBAcGBwAAAAAAAAEAAgMEESESMQUTQSJRYYEUIzJCcaGx BhUWkdHhQ1JyguLw8f/aAAwDAQACEQMRAD8ASI+7+N8WVuiNuiPgaHinPXkr115TloWWpjvbedj9 FCT8psS3py88I+N8SNPHZvtu28PFFU0Oo36L0dDTxQxrHGqpEgCoigBVUCwVQPADHz3ckndMLr7M jFOSsR5BL3v5eF8edfyUtOVVENZJGdcDR8ySTc8v1APP8sYPjwStg9oO4Q/xTw9Q5vl0tFXw7tPI De47ynyeNvJlPhgrhde6CQOBROlkjdLsrzdnuUVGS5rUZdMdbQN3HHLWh7ySf5hj6pTzCWMOHVc3 U05ikLCtn2Io/Z/tb2goetbe92bt1O9f5NW3bV6/Z9cNfQJe76IH0lurT1Q2SAAPMW/fABRCe3Qx VZTkHR1NnOZTLBHU1U88jEd5khAiXSPMDSccPx1jp6oMbkiw/PKa0rDowF1WdN1bXTCDhnLN0yoX p5ahlJYKdLu8at9GB64Y0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