@@ -83,7 +83,7 @@ def strace(pid, duration = 60)
8383
8484 _ , status = Process . waitpid2 ( pid )
8585
86- Console . logger . error ( status ) do |buffer |
86+ Console . error ( status ) do |buffer |
8787 buffer . puts first_line
8888 end unless status . success?
8989
@@ -92,28 +92,28 @@ def strace(pid, duration = 60)
9292
9393pids . each do |pid |
9494 start_times = getrusage ( pid )
95- Console . logger . info ( "Process #{ pid } start times:" , start_times )
95+ Console . info ( "Process #{ pid } start times:" , start_times )
9696
9797 # sleep 60
9898 summary = strace ( pid )
9999
100- Console . logger . info ( "strace -p #{ pid } " ) do |buffer |
100+ Console . info ( "strace -p #{ pid } " ) do |buffer |
101101 summary . each do |fields |
102102 buffer . puts fields . inspect
103103 end
104104 end
105105
106106 end_times = getrusage ( pid )
107- Console . logger . info ( "Process #{ pid } end times:" , end_times )
107+ Console . info ( "Process #{ pid } end times:" , end_times )
108108
109109 if total = summary [ :total ]
110110 process_duration = end_times . utime - start_times . utime
111111 wait_duration = summary [ :total ] [ :seconds ]
112112
113- Console . logger . info ( "Process Waiting: #{ wait_duration . round ( 4 ) } s out of #{ process_duration . round ( 4 ) } s" ) do |buffer |
113+ Console . info ( "Process Waiting: #{ wait_duration . round ( 4 ) } s out of #{ process_duration . round ( 4 ) } s" ) do |buffer |
114114 buffer . puts "Wait percentage: #{ ( wait_duration / process_duration * 100.0 ) . round ( 2 ) } %"
115115 end
116116 else
117- Console . logger . warn ( "No system calls detected." )
117+ Console . warn ( "No system calls detected." )
118118 end
119119end
0 commit comments