mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 16:31:09 +08:00
DEV: Add new chat metrics (#23872)
This adds the following chat metrics: - _chat_open_channels_with_threads_enabled_ — a count of open channels where threading is enabled. - _chat_channel_messages_ — a count of messages sent in a chat channel (i.e. not a personal chat / direct message), within a thread or outside of a thread. - _chat_threaded_messages_ — a count of messages sent within a thread in a chat channel (i.e. not a personal chat / direct messages). - _chat_direct_messages_ — a count of messages sent in a personal chat / direct messages. The metrics added using the plugin API introduced in 098ab29d, and extended in d91456fd. Note that these stats won't be exposed at the `about.json` and the `site/statistics.json` routes.
This commit is contained in:

committed by
GitHub

parent
b43bba7dd7
commit
93ca13e534
@ -489,10 +489,15 @@ after_initialize do
|
||||
register_stat("chat_messages", show_in_ui: true, expose_via_api: true) do
|
||||
Chat::Statistics.about_messages
|
||||
end
|
||||
|
||||
register_stat("chat_users", expose_via_api: true) { Chat::Statistics.about_users }
|
||||
register_stat("chat_channels", expose_via_api: true) { Chat::Statistics.about_channels }
|
||||
|
||||
register_stat("chat_users", expose_via_api: true) { Chat::Statistics.about_users }
|
||||
register_stat("chat_channel_messages") { Chat::Statistics.channel_messages }
|
||||
register_stat("chat_direct_messages") { Chat::Statistics.direct_messages }
|
||||
register_stat("chat_open_channels_with_threads_enabled") do
|
||||
Chat::Statistics.open_channels_with_threads_enabled
|
||||
end
|
||||
register_stat("chat_threaded_messages") { Chat::Statistics.threaded_messages }
|
||||
|
||||
# Make sure to update spec/system/hashtag_autocomplete_spec.rb when changing this.
|
||||
register_hashtag_data_source(Chat::ChannelHashtagDataSource)
|
||||
|
Reference in New Issue
Block a user