2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/lib/stats_socket.rb
Sam Saffron f04fbf911a FEATURE: in vim dev you can focus on spec line in autospec
instructions in bin/notify_file_change
2017-04-25 09:13:29 -07:00

23 lines
321 B
Ruby

require 'socket_server'
class StatsSocket < SocketServer
def initialize(socket_path)
super(socket_path)
end
protected
def get_response(command)
result =
case command
when "gc_stat"
GC.stat.to_json
else
"[\"UNKNOWN COMMAND\"]"
end
result << "\n"
end
end