<commit_before>module Jobs
  class DailyPerformanceReport < Jobs::Scheduled
    every 1.day
    per_host

    def execute(args)
      if SiteSetting.daily_performance_report
        result = `ruby #{Rails.root}/script/nginx_analyze.rb --limit 1440`
        if result.strip.empty?
          result = "Report is only available in latest image, please run: \n\n cd /var/discourse && ./launcher rebuild app"
        end
        report_data = "```text\n#{result}\n```"

        PostCreator.create(Discourse.system_user,
                      topic_id: performance_topic_id,
                      raw: report_data,<commit_msg>correct formatting<commit_after>module Jobs
  class DailyPerformanceReport < Jobs::Scheduled
    every 1.day
    per_host

    def execute(args)
      if SiteSetting.daily_performance_report
        result = `ruby #{Rails.root}/script/nginx_analyze.rb --limit 1440`
        report_data =
          if result.strip.empty?
            "Report is only available in latest image, please run:
```text
cd /var/discourse
./launcher rebuild app
```"
          else
            "```text\n#{result}\n```"
          end

        PostCreator.create(Discourse.system_user,
                      topic_id: performance_topic_id,
                      raw: report_data,
{'fraction_non_alphanumeric': 0.09505106048703849, 'fraction_numerical': 0.007855459544383346, 'mean_word_length': 2.241730279898219, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2642261', 'n_tokens_mistral': 392, 'n_tokens_neox': 354, 'n_words': 86}