<commit_before>json.meta do
  json.status "ok"
  json.message_type "metrics-list"
  json.message_version "6.0.0"
  json.total @works.total_entries
  json.total_pages (@works.total_entries.to_f / @works.per_page).ceil
  json.page @works.total_entries > 0 ? @works.current_page : 0
  json.error @error
end

json.works @works do |work|
  json.cache! ['v5', work], skip_digest: true do
    json.(work, :id, :issued, :update_date)

    if work.tracked
      json.sources work.filtered_retrieval_statuses do |rs|
        json.cache! ['v5', rs, params[:info]], skip_digest: true do
          json.(rs, :name, :title, :group_name, :events_url, :by_day, :by_month, :by_year, :metrics, :update_date)
          json.events rs.events if params[:info] == "detail"
        end
      end
    end
  end
end<commit_msg>cache v6 metrics api. #287<commit_after>json.meta do
  json.status "ok"
  json.message_type "metrics-list"
  json.message_version "6.0.0"
  json.total @works.total_entries
  json.total_pages (@works.total_entries.to_f / @works.per_page).ceil
  json.page @works.total_entries > 0 ? @works.current_page : 0
  json.error @error
end

json.works @works do |work|
  json.cache! ['v61', work], skip_digest: true do
    json.(work, :id, :issued, :update_date)

    if work.tracked
      json.sources work.filtered_retrieval_statuses do |rs|
        json.cache! ['v6', rs], skip_digest: true do
          json.(rs, :name, :title, :group_name, :events_url, :by_day, :by_month, :by_year, :metrics, :update_date)
          json.events rs.events if params[:info] == "detail"
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13474734872114785, 'fraction_numerical': 0.011852776044915784, 'mean_word_length': 3.370572207084469, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5206891', 'n_tokens_mistral': 589, 'n_tokens_neox': 571, 'n_words': 138}