About Page サイト統計参照ガイド

:bookmark: これは、/about ページの統計情報がどのように計算されるか、および各統計情報の Ruby コードがどこにあるかを説明するためのリファレンス ガイドです。

:person_raising_hand: 必要なユーザーレベル: 全ユーザー

About Page Statistics

すべての Discourse サイトには、組み込みの /about ページがあります(例: Meta の About ページはこちら)。このページには、サイトの管理者とモデレーターのリストと、サイト自体に関するいくつかの統計情報が含まれています。

これらの統計情報には、管理者およびモデレーターのアカウントを含む、すべてのユーザーが含まれます。一部の統計情報には、匿名アカウント(サイトで有効になっている場合)も含まれます。

share anonymized statistics サイト設定が有効になっている場合(デフォルトで有効)、/about ページの「Site Statistics」は JSON ファイルとして公開され、/about.json で取得できます。

サイトが公開されている場合、/about ページとこれらの統計情報も公開されます。

:gem: これらの統計情報のすべての Ruby コードは、discourse/app/models/about.rb にあります。

以下に、これらの統計情報がどのように計算されるかの説明を示します。

Topics

指定された期間内に作成されたトピックの数。この統計情報には、リストされていないトピックや個人メッセージは含まれません。

topic_count: Topic.listable_topics.count,
topics_last_day: Topic.listable_topics.where('created_at > ?', 1.days.ago).count,
topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count,
topics_30_days: Topic.listable_topics.where('created_at > ?', 30.days.ago).count,

Posts

指定された期間内に作成された投稿の数。個人メッセージはここに含められ、通常の投稿としてカウントされます。

post_count: Post.count,
posts_last_day: Post.where('created_at > ?', 1.days.ago).count,
posts_7_days: Post.where('created_at > ?', 7.days.ago).count,
posts_30_days: Post.where('created_at > ?', 30.days.ago).count,

Sign-Ups

指定された期間内に新しいアカウントにサインアップしたユーザーの数。

user_count: User.real.count,
users_last_day: User.real.where('created_at > ?', 1.days.ago).count,
users_7_days: User.real.where('created_at > ?', 7.days.ago).count,
users_30_days: User.real.where('created_at > ?', 30.days.ago).count,

:gem: real ユーザーの定義は次のとおりです: discourse/app/models/user.rb

Active Users

指定された期間内にサイトを訪問したユーザーの数。匿名モードのユーザーが含まれますが、アカウントを持たないユーザーは含まれません。

active_users_last_day: User.where('last_seen_at > ?', 1.days.ago).count,
active_users_7_days: User.where('last_seen_at > ?', 7.days.ago).count,
active_users_30_days: User.where('last_seen_at > ?', 30.days.ago).count,

Likes

指定された期間内に、すべてのトピックと投稿が受け取ったいいねの総数。

like_count: UserAction.where(action_type: UserAction::LIKE).count,
likes_last_day: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 1.days.ago).count,
likes_7_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 7.days.ago).count,
likes_30_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 30.days.ago).count

Chat Messages

すべてのチャネルで送信されたチャットメッセージの数。

:information_source: これは最近追加された統計情報であり、この追加に関する詳細はこちらで見つけることができます。

「いいね!」 6