feat: add message and event count metric#76
Conversation
e950583 to
3dce890
Compare
6e65f57 to
88bd92b
Compare
| self._clock.looping_call(self.set_known_rooms_gauge, HOUR_IN_MS) | ||
| self._clock.looping_call(self.set_locally_joined_rooms_gauge, HOUR_IN_MS) | ||
| # update message metrics every 60 minutes | ||
| self._clock.looping_call(self.set_messages_by_source_gauge, HOUR_IN_MS) |
There was a problem hiding this comment.
I think we want message metrics at least every 5 minutes. Otherwise this will have too large jumps and not be that useful.
3dce890 to
0716acb
Compare
Thank you Jason for checking this! A |
|
I think we want totals, so that we can create a time series manually. Running it every 5 minutes is probably fine, but creating an index doesn't sound too terrible either, but likely will have to happen as a background job? |
If we have to update metric on every events, I would consider adding count logic, since the table is pretty big.(Probably nice to have a sync logic to check if the value is equal to DB.) Otherwise if it's not too time-critical, I like to fetch info every 5 minutes from DB. Is there better approach to do it other than background job? |
Both approaches sound fine to me :) |
85ee9b1 to
56313f0
Compare
|
closing with #146 |


Expose message & event counts in synapse #3264
synapse_messages_by_source:select COUNT(*) from events where type = 'm.room.message' or type = 'm.room.encrypted' and sender like '@%:tim-alpha.staging.famedly.de';, where the like query matches local events vs remote events.synapse_events_by_source: Same as the above but not filtered by type.synapse_encrypted_by_source: Same as the above, but onlym.room.encryptedmessages.