annotate mod_stats39/README.markdown @ 3877:562b34050561

mod_rest: Add basic support for XEP-0050: Ad-Hoc commands (no forms) This allows calling simple commands like the one provided by mod_uptime
author Kim Alvefur <zash@zash.se>
date Tue, 04 Feb 2020 21:49:14 +0100
parents 117f0fb8cb15
children f1a63271dcfc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3844
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 This module provides **public** access to Prosodys
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 [internal statistics][doc:statistics] trough the
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 [XEP-0039: Statistics Gathering] protocol. This is a simple protocol
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 that returns triplets of name, unit and value for each know statistic
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 collected by Prosody. The names used are the internal names assigned by
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 modules or statsmanager, names from the registry are **not** used.
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 # Configuration
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 Enabled as usual by adding to [`modules_enabled`][doc:modules_enabled]:
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 ```lua
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 -- Enable Prosodys internal statistics gathering
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 statistics = "internal"
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 -- and enable the module
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17 modules_enabled = {
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 -- other modules
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 "stats39";
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 }
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 ```
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 # Usage
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 ## Example
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 Statistics can be queried from the XML console of clients that have one:
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 ```xml
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31 C:
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32 <iq type="get" to="example.com" id="dTMERjt5">
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 <query xmlns="http://jabber.org/protocol/stats"/>
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 </iq>
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36 S:
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
37 <iq type="result" to="example.com" id="dTMERjt5">
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
38 <query xmlns="http://jabber.org/protocol/stats">
3845
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
39 <stat name="cpu.clock:amount" value="0.212131"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
40 <stat name="cpu.percent:amount" value="0"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
41 <stat name="memory.allocated:amount" value="8.30259e+06"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
42 <stat name="memory.allocated_mmap:amount" value="401408"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
43 <stat name="memory.lua:amount" value="6.21347e+06"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
44 <stat name="memory.returnable:amount" value="13872"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
45 <stat name="memory.rss:amount" value="2.03858e+07"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
46 <stat name="memory.total:amount" value="6.53885e+07"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
47 <stat name="memory.unused:amount" value="14864"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
48 <stat name="memory.used:amount" value="8.28773e+06"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
49 <stat name="/*/mod_c2s/connections:amount" value="0"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
50 <stat name="/*/mod_c2s/ipv6:amount" value="0"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
51 <stat name="/*/mod_s2s/connections:amount" value="0"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
52 <stat name="/*/mod_s2s/ipv6:amount" value="0"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
53 <stat name="stats.collection:duration" unit="seconds" value="0.000125647"/>
117f0fb8cb15 mod_stats39: Add actual example stats
Kim Alvefur <zash@zash.se>
parents: 3844
diff changeset
54 <stat name="stats.processing:duration" unit="seconds" value="0"/>
3844
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
55 </query>
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
56 </iq>
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
57 ```
c240934703bc mod_stats39: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
58