From 42bf010f8ac940d9981fa67b4d650bed21ecc33b Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 12 May 2014 09:06:28 +1000 Subject: [PATCH] Add more stats to version check --- lib/discourse_hub.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/discourse_hub.rb b/lib/discourse_hub.rb index 9f417cfb194..9087f782c9c 100644 --- a/lib/discourse_hub.rb +++ b/lib/discourse_hub.rb @@ -60,19 +60,27 @@ module DiscourseHub end end - - def self.discourse_version_check - get('/version_check', { + def self.version_check_payload + { installed_version: Discourse::VERSION::STRING, forum_title: SiteSetting.title, forum_description: SiteSetting.site_description, forum_url: Discourse.base_url, contact_email: SiteSetting.contact_email, topic_count: Topic.listable_topics.count, + post_count: Post.count, user_count: User.count, + topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count, + posts_7_days: Post.where('created_at > ?', 7.days.ago).count, + users_7_days: User.where('created_at > ?', 7.days.ago).count, login_required: SiteSetting.login_required, locale: SiteSetting.default_locale - }) + } + end + + + def self.discourse_version_check + get('/version_check', version_check_payload) end