<commit_before>class StatsController < ApplicationController
  before_filter :login_required
  respond_to :json

  def websockets
    connection_count = $redis.get("Stats:Websockets:connection-count")
    connected_users = JSON.parse($redis.get("Stats:Websockets:connected-users")) rescue {}
    result = {connections: WebsocketServer.connection_count, users: WebsocketServer.connected_users}
    respond_with result
  end
end
<commit_msg>Fix socket stats<commit_after>class StatsController < ApplicationController
  before_filter :login_required
  respond_to :json

  def websockets
    connection_count = $redis.get("Stats:Websockets:connection-count")
    connected_users = JSON.parse($redis.get("Stats:Websockets:connected-users")) rescue {}
    result = {connections: connection_count, users: connected_users}
    respond_with result
  end
end

{'fraction_non_alphanumeric': 0.0895170789163722, 'fraction_numerical': 0.0, 'mean_word_length': 6.024793388429752, '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': '5431415', 'n_tokens_mistral': 245, 'n_tokens_neox': 238, 'n_words': 48}