Skip to content

Commit a2a59bd

Browse files
committed
docs: Change headings a bit
1 parent 6ca5197 commit a2a59bd

1 file changed

Lines changed: 32 additions & 24 deletions

File tree

docs/accounting.rst

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ When running a shared cluster for multiple tenants, you may want to monitor clus
66
or even compute accountable usage numbers per tenant. There are several ways to achieve
77
this goal, all with their own benefits and drawbacks.
88

9-
Working with `events.xml`
10-
=========================
9+
Parsing raw `events.xml` files
10+
==============================
1111

1212
You could use tenant overrides to enforce `meetingKeepEvents=true` during meeting creation,
1313
and then collect and analyse the `events.xml` files from all your BBB servers.
1414

1515
This is the most detailed, but also most invasive approach because `events.xml` contains
16-
WAY more data than necessary, including participant names and chat messages. You should
17-
definitely speak to your *Data Protection Officer* to make sure this is okay.
16+
WAY more data than necessary, including participant names and chat messages, even
17+
private chats. You should definitely speak to your *Data Protection Officer* to make
18+
sure this is okay.
1819

1920
You'd also need to parse and process `events.xml` yourself. I'm not aware of any
2021
ready-to-use tool to get usage statistics out of those even streams.
2122

2223

23-
Enabling `ANALYTICS_STORE`
24-
==========================
24+
Collecting analytics data
25+
=========================
2526

2627
Similar to the `events.xml` approach you can use tenant overrides to enforce
2728
`meetingKeepEvents=true` during meeting creation, but instead of fetching and parsing raw
@@ -36,8 +37,8 @@ need to get rid of the `events.xml` files on your BBB servers in a timely manner
3637
get in conflict with GDPR.
3738

3839

39-
Enabling `POLL_STATS`
40-
=====================
40+
Detailed metrics with `POLL_STATS`
41+
==================================
4142

4243
.. versionadded:: 0.0.17
4344

@@ -46,28 +47,35 @@ Enabling `POLL_STATS`
4647
This is an experimental feature.
4748

4849

49-
BBBLB can store meeting statistics (namely `users`, `voice` and `video` counts) into the
50-
database, allowing you to run your own queries and analytics. This is disabled by default,
51-
because one database row per meeting per `POLL_INTERVAL` quickly adds up and there is no
52-
automatic cleanup. You'll have to delete old rows yourself and make sure your database can
53-
handle it. On the plus side, those numbers won't contain any personal data, just meeting
54-
IDs and counters.
50+
BBBLB can collect detailed metrics and store them in the database, allowing you to run
51+
your own SQL queries to get any statistics you may need. Once activated with the
52+
`POLL_STATS` setting, the meeting poller will store the current `users`, `voice` and
53+
`video` counts for each running meeting on each server poll. Those metrics do not
54+
contain any personal data, which makes this approach very GDPR friendly.
5555

56-
Once activated with the `POLL_STATS` setting, the meeting poller will store the current
57-
user, voice and video stream count per meeting on each poll. You can write your own SQL
58-
queries to get what you need. A common approach would be to fetch all rows in a certain
59-
time range, calculate average values per meeting, then group those together by tenant.
56+
The `POLL_STATS` feature is disabled by default, because the database table will grow by
57+
one row per meeting per `POLL_INTERVAL` and there is no automatic cleanup. This adds up
58+
quickly, especially for large or busy clusters. Make sure to delete old rows regularly
59+
to keep your database size in check.
6060

61-
Here is an (untested) example query that shows most of the techniques:
61+
The `meeting_stats` table is structured similar to a time series database. Each row has
62+
a timestamp (`ts`), the `uuid` of the meeting, the reuseable external `meeting_id` that
63+
was used to create the meeting, the owning tenant (`tenant_fk`), and three metric values
64+
named `users`, `voice` and `video`.
65+
66+
Here is an (untested) example PostgreSQL query returning some useful aggregations. It
67+
fetches all rows in a certain time range, calculate min/max/average values per meeting
68+
(per `uuid`), then groups those together by `tenant_fk` to get meaningfull aggregated
69+
values per tenant:
6270

6371
.. code:: sql
6472
6573
SELECT
6674
tenants.name,
67-
/* Total number of meeting minutes spent by each participant */
68-
SUM(users_avg * EXTRACT(epoch FROM started - ended)) / 60,
75+
/* Total number of meeting minutes spent by all users combined */
76+
SUM(users_avg * EXTRACT(epoch FROM duration)) / 60,
6977
/* Average meeting duration in minutes */
70-
AVG(EXTRACT(epoch FROM started - ended)) / 60,
78+
AVG(EXTRACT(epoch FROM duration)) / 60,
7179
/* Aveage meeting size */
7280
AVG(users_avg),
7381
/* Maximum meeting size */
@@ -80,8 +88,7 @@ Here is an (untested) example query that shows most of the techniques:
8088
SELECT
8189
tenant_fk,
8290
uuid,
83-
MIN(ts) AS started,
84-
MAX(ts) AS ended,
91+
MAX(ts) - MIN(ts) as duration
8592
AVG(users) AS users_avg
8693
MAX(users) AS users_max
8794
FROM meeting_stats
@@ -90,3 +97,4 @@ Here is an (untested) example query that shows most of the techniques:
9097
)
9198
INNER JOIN tenants ON (tenant_fk = tenants.id)
9299
GROUP BY tenants.name
100+

0 commit comments

Comments
 (0)