annotate mod_http_stats_stream/README.markdown @ 2491:5fbca7de2088

mod_smacks: Send out more ack requests where needed Under some circumstances it was possible that more than "max_unacked_stanzas" where left in the outgoing stanza queue without forcing an ack. This could happen, when more stanzas entered the queue while the last ack request was still unanswered. Now the test "#queue > max_unacked_stanzas" is done upon receiving an ack as well as when sending out stanzas, which fixes this bug.
author tmolitor <thilo@eightysoft.de>
date Sun, 12 Feb 2017 19:27:50 +0100
parents c98b37d6d86c
children 740870196b97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2480
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 ---
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 depends:
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 - 'mod\_http'
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 provides:
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 - http
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 ---
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 # Introduction
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 This module provides a streaming interface to [Prosodys internal statistics][doc:statistics] via
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 [Server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 ## Example
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 ```js
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 var evtSource = new EventSource("/stats_stream");
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 /*
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 * An event with all current statistics in the form of a JSON object.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 * Normally sent only once, when first connected to the stream.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 */
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 evtSource.addEventListener("stats-full", function(e) {
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 var initial_stats = JSON.parse(e.data);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 console.log(initial_stats);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25 }, false);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 /*
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 * An event containing only statistics that have changed since the last
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 * 'stats-full' or 'stats-updated' event.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 */
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31 evtSource.addEventListener("stats-updated", function(e) {
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32 var updated_stats = JSON.parse(e.data);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 console.log(updated_stats);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 }, false);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 ```
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
37