element-hq / element-hq/synapse
Implement simple homeserver users activity statistics (outgoing event count per hour/day)
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#6007](https://github.com/matrix-org/synapse/issues/6007).
---
On our public ru-matrix.org homeserver "Glowers club" spammers goes to register new accounts, when I block manually affected account, they register new. So I searching the way to automate detection of spamming accounts, via some metrics, for example - outgoing event count per hour/day.
At now all events are stored in one large `event_json` sql table, but this have no separate indexed field for event author (user_id), so filtering user-owned events from whole table will be too expensive. And I can't see some other table, where can I get events, filtered by mxid.
Maybe some other Synapse tables exists, in which I can simply do something like `SELECT COUNT(event_id) FROM xxx WHERE timestamp > 12345 AND server = 'myhomeserver.org' GROUP BY user_id`?
Or maybe already exists some Synapse module, that will fill `users_stat` sql table with right info (now it have 0 records)?
If not, can you implement some easy-to-use statistic reports of homeserver users, for quickly detecting too active ~spammers~ users for automate alarming and blocking?
Contributor guide
Assessment
This issue has not been assessed yet.