diff options
author | 2022-11-28 20:51:27 +0000 | |
---|---|---|
committer | 2022-11-28 20:51:27 +0000 | |
commit | 2c5bfa74c18c1669295dadc51f597fdec5c8436a (patch) | |
tree | 2572b73a5a6b4086f406bed216ae69632cf28046 | |
parent | Merge pull request #2347 from shtlrs/improve-get-or-fetch-channel-type-hints (diff) | |
parent | Use the old stat slugs in new help system (diff) |
Merge pull request #2349 from python-discord/record-help-channel-claims
Use the old stat slugs in new help system
-rw-r--r-- | bot/exts/help_channels/_channel.py | 1 | ||||
-rw-r--r-- | bot/exts/help_channels/_stats.py | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index 0cee24817..5c47a3559 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -117,6 +117,7 @@ async def send_opened_post_dm(post: discord.Thread) -> None: async def help_post_opened(opened_post: discord.Thread, *, reopen: bool = False) -> None: """Apply new post logic to a new help forum post.""" _stats.report_post_count() + bot.instance.stats.incr("help.claimed") if not isinstance(opened_post.owner, discord.Member): log.debug(f"{opened_post.owner_id} isn't a member. Closing post.") diff --git a/bot/exts/help_channels/_stats.py b/bot/exts/help_channels/_stats.py index 8ab93f19d..1075b439e 100644 --- a/bot/exts/help_channels/_stats.py +++ b/bot/exts/help_channels/_stats.py @@ -23,7 +23,7 @@ class ClosingReason(Enum): def report_post_count() -> None: """Report post count stats of the help forum.""" help_forum = bot.instance.get_channel(constants.Channels.help_system_forum) - bot.instance.stats.gauge("help_forum.total.in_use", len(help_forum.threads)) + bot.instance.stats.gauge("help.total.in_use", len(help_forum.threads)) async def report_complete_session(help_session_post: discord.Thread, closed_on: ClosingReason) -> None: @@ -32,13 +32,13 @@ async def report_complete_session(help_session_post: discord.Thread, closed_on: `closed_on` is the reason why the post was closed. See `ClosingReason` for possible reasons. """ - bot.instance.stats.incr(f"help_forum.dormant_calls.{closed_on.value}") + bot.instance.stats.incr(f"help.dormant_calls.{closed_on.value}") open_time = discord.utils.snowflake_time(help_session_post.id) in_use_time = arrow.utcnow() - open_time - bot.instance.stats.timing("help_forum.in_use_time", in_use_time) + bot.instance.stats.timing("help.in_use_time", in_use_time) if await _caches.posts_with_non_claimant_messages.get(help_session_post.id): - bot.instance.stats.incr("help_forum.sessions.answered") + bot.instance.stats.incr("help.sessions.answered") else: - bot.instance.stats.incr("help_forum.sessions.unanswered") + bot.instance.stats.incr("help.sessions.unanswered") |