Skip to content
Browse files

Make sure the logs directory exists.

  • Loading branch information...
1 parent 277ce9d commit ba7a3963dae5cf7332bebbace2d927b5c8269bb1 @watsonian committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/mem_watcher.rb
View
2 lib/mem_watcher.rb
@@ -2,6 +2,7 @@
require 'yaml'
require 'sinatra'
require 'mem_info'
+require 'fileutils'
require 'erb'
class MemWatcher < Sinatra::Base
@@ -71,6 +72,7 @@ def update_max_memused!(cur_meminfo)
end
def save_process_list!(cur_meminfo)
+ FileUtils.mkdir_p("./log/procs")
system("ps auxr > log/procs/`date \"+%Y%m%d_%H%M%S-#{@@max_memused}-#{cur_meminfo.memused}\"`.snapshot.out")
end

0 comments on commit ba7a396

Please sign in to comment.
Something went wrong with that request. Please try again.