RoadRunner 3.3.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -13
- data/bin/controller.rb +74 -0
- data/bin/host_mgr.rb +69 -0
- data/bin/nbd_prepare.sh +87 -0
- data/conf/servers.yaml +29 -0
- data/controller/dd.sh +91 -0
- data/controller/mysql.rb +73 -0
- data/controller/mysql.sh +9 -0
- data/controller/svn.sh +48 -0
- data/controller/wrap.rb +49 -0
- data/lib/roadrunner.rb +11 -9
- data/lib/rrmonitor.rb +174 -0
- data/lib/run.rb +66 -27
- data/log/dd.log +129 -0
- data/log/log.rb +17 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.26/Pi-Monitor-Performance/ifstat.log +239 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.26/Pi-Monitor-Performance/iostat_3.log +668 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.26/Pi-Monitor-Performance/vmstat_3.log +81 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.26/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +2248 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.26/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +719 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.27/Pi-Monitor-Performance/ifstat.log +245 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.27/Pi-Monitor-Performance/iostat_3.log +677 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.27/Pi-Monitor-Performance/vmstat_3.log +83 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.27/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +2276 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.27/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +737 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.28/Pi-Monitor-Performance/ifstat.log +246 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.28/Pi-Monitor-Performance/iostat_3.log +677 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.28/Pi-Monitor-Performance/vmstat_3.log +83 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.28/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +2195 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.28/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +737 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.29/Pi-Monitor-Performance/ifstat.log +247 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.29/Pi-Monitor-Performance/iostat_3.log +686 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.29/Pi-Monitor-Performance/vmstat_3.log +84 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.29/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +2386 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.29/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +828 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.30/Pi-Monitor-Performance/ifstat.log +249 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.30/Pi-Monitor-Performance/iostat_3.log +686 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.30/Pi-Monitor-Performance/vmstat_3.log +84 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.30/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +2304 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.3.30/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +664 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.6.30/Pi-Monitor-Performance/ifstat.log +240 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.6.30/Pi-Monitor-Performance/iostat_3.log +1334 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.6.30/Pi-Monitor-Performance/vmstat_3.log +82 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.6.30/Pi-Monitor-Performance/while__1_0___do_sar_-u_-d_3_10__done.log +9048 -0
- data/log/monitor/Pi-Monitor-Performance/10.250.6.30/Pi-Monitor-Performance/while__1_0___do_sar_-u_-n_DEV_3_10__done.log +968 -0
- data/log/stdout.log +0 -0
- data/log/stdout.log.20100307 +349 -0
- data/log/svn.log +502 -0
- data/test/download_processes.rb +38 -0
- data/test/pi_monitor.rb +45 -0
- metadata +54 -17
- data/lib/roadrunner_stdout.log +0 -168
- data/lib/roadrunner_stdout.log.20090519 +0 -262
- data/lib/roadrunner_stdout.log.20090521 +0 -47
- data/lib/roadrunner_stdout.log.20090524 +0 -290
- data/test/roadrunner_stdout.log +0 -170
- data/test/roadrunner_stdout.log.20090429 +0 -394
data/controller/mysql.sh
ADDED
data/controller/svn.sh
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#file-name=svn.sh
|
3
|
+
|
4
|
+
cd /home/cuizheng
|
5
|
+
#LOG=/home/cuizheng/log/nbd_perf_svn_`date +"%Y-%m-%d=%H:%M:%S"`.log
|
6
|
+
LOG=/home/cuizheng/log/svn.log
|
7
|
+
|
8
|
+
|
9
|
+
cd /home/cuizheng/file1
|
10
|
+
rm -rf *
|
11
|
+
sync
|
12
|
+
cp /root/code ./ -r
|
13
|
+
sync
|
14
|
+
rm -rf /home/cuizheng/file2/*
|
15
|
+
sync
|
16
|
+
|
17
|
+
|
18
|
+
i=1
|
19
|
+
|
20
|
+
while [ $i -le 10 ];
|
21
|
+
do
|
22
|
+
|
23
|
+
START=`date +"%s"`
|
24
|
+
mv /home/cuizheng/file1/* /home/cuizheng/file2/
|
25
|
+
sync
|
26
|
+
END=`date +"%s"`
|
27
|
+
echo "
|
28
|
+
mv /home/cuizheng/file1/* /home/cuizheng/file2/
|
29
|
+
sync
|
30
|
+
START:$START,END:$END,SPEND:$((END-START))
|
31
|
+
|
32
|
+
" >>$LOG
|
33
|
+
|
34
|
+
START=`date +"%s"`
|
35
|
+
mv /home/cuizheng/file2/* /home/cuizheng/file1/
|
36
|
+
sync
|
37
|
+
END=`date +"%s"`
|
38
|
+
echo "
|
39
|
+
mv /home/cuizheng/file2/* /home/cuizheng/file1/
|
40
|
+
sync
|
41
|
+
START:$START,END:$END,SPEND:$((END-START))
|
42
|
+
|
43
|
+
" >> $LOG
|
44
|
+
|
45
|
+
i=$(($i + 1))
|
46
|
+
done
|
47
|
+
|
48
|
+
exit 1
|
data/controller/wrap.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
module RoadRunnerModule
|
4
|
+
|
5
|
+
class Wrap
|
6
|
+
|
7
|
+
def initialize(opt={})
|
8
|
+
@SHELL=opt[:sh]
|
9
|
+
@NUM=opt[:n]||10
|
10
|
+
@log=opt[:log]
|
11
|
+
@PIDS=[]
|
12
|
+
@log.debug "Wrap initialize parameters => #{opt.inspect}"
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
def start!
|
17
|
+
@log.info "DSMP perftest start!".center(60,'*')
|
18
|
+
|
19
|
+
@NUM.times do|i|
|
20
|
+
@log.info "sh #{@SHELL} >> #{@SHLOG} 2>&1"
|
21
|
+
@PIDS << Process.fork do
|
22
|
+
@log.info `sh #{@SHELL} 2>&1`
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
@log.info "Waiting Processes => #{@PIDS.inspect}"
|
27
|
+
Process.waitall
|
28
|
+
@log.info "Processes down."
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
def end!
|
33
|
+
@PIDS.each do |x|
|
34
|
+
@log.debug %x"kill -9 #{x}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
module Work
|
42
|
+
def self.work(n,log,sh)
|
43
|
+
svn=Wrap.new({:n=>n,:log=>log,:sh=>sh })
|
44
|
+
svn.start!
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
data/lib/roadrunner.rb
CHANGED
@@ -10,12 +10,7 @@ require 'benchmark'
|
|
10
10
|
require 'logger'
|
11
11
|
require 'pp'
|
12
12
|
|
13
|
-
require
|
14
|
-
require 'action'
|
15
|
-
require 'ended'
|
16
|
-
require 'run'
|
17
|
-
require 'report'
|
18
|
-
require 'rrhelper'
|
13
|
+
Dir[File.join(File.dirname(__FILE__),"*.rb")].select{|x|not (x =~ /.*model\.rb/ || x =~ /.*db\.rb/ || x =~ /.*roadrunner\.rb/)}.each { |x| require x }
|
19
14
|
|
20
15
|
class RoadRunner
|
21
16
|
|
@@ -34,18 +29,25 @@ class RoadRunner
|
|
34
29
|
|
35
30
|
def initialize(opts={})
|
36
31
|
# => DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
|
37
|
-
opts = {:out=>"
|
32
|
+
opts = {:out=>File.join(File.dirname(__FILE__),'..','log',"stdout.log"),:frequency=>'daily',:size=>1048576,:level=>Logger::DEBUG}.merge opts
|
38
33
|
@users,@iterations,@longest,@userId,@iterationId=1,1,0,0,0
|
39
34
|
@initBlk,@actBlk,@endBlk=proc{},proc{},proc{}
|
40
35
|
@global,@transactions={},{}
|
41
36
|
@log=Logger.new(opts[:out],opts[:frequency],opts[:size])
|
42
37
|
@log.level=opts[:level]
|
43
|
-
# => mode : sequence,
|
38
|
+
# => mode : sequence<default>,thread|t,process|p
|
44
39
|
@mode='sequence'
|
45
40
|
|
46
41
|
if block_given? then
|
47
|
-
|
42
|
+
begin
|
43
|
+
gem 'active_record'
|
44
|
+
require 'active_record'
|
45
|
+
rescue Exception => e
|
46
|
+
require 'activerecord'
|
47
|
+
end
|
48
|
+
|
48
49
|
require 'db'
|
50
|
+
require "model"
|
49
51
|
|
50
52
|
session = {}
|
51
53
|
_session = yield session
|
data/lib/rrmonitor.rb
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "net/ssh"
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
module RoadRunnerModule
|
6
|
+
|
7
|
+
=begin
|
8
|
+
RRMonitor is used for Xnix system.
|
9
|
+
=end
|
10
|
+
|
11
|
+
class RRMonitor
|
12
|
+
def initialize(opt={:server=>"0.0.0.0", :username=>"admin", :password=>"123456"})
|
13
|
+
raise(ArgumentError,"Logger is needed!") unless opt[:log]
|
14
|
+
@log=opt[:log]
|
15
|
+
|
16
|
+
@server=opt[:server]
|
17
|
+
|
18
|
+
begin
|
19
|
+
@sess=Net::SSH.start(opt[:server], opt[:username], :password => opt[:password],:timeout => 120)
|
20
|
+
@log.info "#{opt[:server]} ssh connection OK."
|
21
|
+
rescue Exception => e
|
22
|
+
@log.error e
|
23
|
+
@log.error opt.inspect
|
24
|
+
raise e
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
@log.info("monitor initialize.".center(60,"*"))
|
29
|
+
@log.debug("monitor => #{self.inspect}")
|
30
|
+
|
31
|
+
@ts=( opt[:ts] || Time.now.to_i )
|
32
|
+
|
33
|
+
@path="#{File.join File.dirname(__FILE__),'..','log'}/monitor/#{@ts}"
|
34
|
+
@log.info "monitor local log path :#{@path}"
|
35
|
+
|
36
|
+
@rpath="~/.monit/#{@ts}"
|
37
|
+
@log.info "monitor remote log path(rpath) :#{@rpath}"
|
38
|
+
|
39
|
+
@sess.exec!("rm -rf #{@rpath}")
|
40
|
+
@sess.exec!("mkdir -p #{@rpath}")
|
41
|
+
|
42
|
+
@pids={}
|
43
|
+
end
|
44
|
+
|
45
|
+
=begin
|
46
|
+
run!(cmd) =>
|
47
|
+
the cmd will be execed at remote server(0),
|
48
|
+
and the stdout will write in log file.
|
49
|
+
|
50
|
+
cmd =>[
|
51
|
+
'ifstat',# network io
|
52
|
+
'iostat 3',# disk io
|
53
|
+
'vmstat 3',# memory info
|
54
|
+
'while((1>0));do sar -u -d 3 10; done',# disk and cpu info
|
55
|
+
'while((1>0));do sar -u -n DEV 3 10; done'# network and cpu info
|
56
|
+
]
|
57
|
+
|
58
|
+
"while((1>0));do #{cmd}; done" is needed for non-consist output cmd.
|
59
|
+
|
60
|
+
cmd sample =>
|
61
|
+
|
62
|
+
run!(["while((1>0));do /home/admin/apsara/build/debug64/bin/ku --command=getallpart --appname=blog1 --interactive=false|tail -n1; done"])
|
63
|
+
|
64
|
+
when exec!(cmd)
|
65
|
+
=>
|
66
|
+
exec!("while((1>0));do /home/admin/apsara/build/debug64/bin/ku --command=getallpart --appname=blog1 --interactive=false|tail -n1; done >> #{kupath} 2>/dev/null &")
|
67
|
+
=end
|
68
|
+
|
69
|
+
def run!(cmd=['ifstat','iostat 3','while((1>0));do sar -u -d 3 10; done','vmstat 3','while((1>0));do sar -u -n DEV 3 10; done'])
|
70
|
+
(@log.error "run!(cmd) cmd type require array.";exit) unless cmd.is_a?(Array)
|
71
|
+
(@log.error "run!(cmd) require commands.";exit) if cmd.none?
|
72
|
+
|
73
|
+
@cmd=cmd
|
74
|
+
|
75
|
+
begin
|
76
|
+
@log.info("RUN!".center(60,"*"))
|
77
|
+
@log.debug @server
|
78
|
+
cmd.each { |e| self.exec!(e)}
|
79
|
+
rescue Exception => e
|
80
|
+
@log.error("#{self.inspect} run error!")
|
81
|
+
@log.error(e.to_s)
|
82
|
+
# raise e
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
def exec!(cmd)
|
88
|
+
# >> cmd='while((1>0));do sar -u -d 3 10; # done';cmdpath="#{cmd.gsub(/([^a-zA-Z0-9\-])/,'_')}.log"
|
89
|
+
# => "while__1_0___do_sar_-u_-d_3_10__done.log"
|
90
|
+
|
91
|
+
# cmdpath="#{@rpath}/#{cmd.gsub(/[\s|\t|\$|\`|\(|\)|\&|\>|\<|\;|\||\'|\"]/,'_')}.log"
|
92
|
+
cmdpath="#{@rpath}/#{cmd.gsub(/[^a-zA-Z0-9\-]/,'_')}.log"
|
93
|
+
@cmdpath=cmdpath
|
94
|
+
|
95
|
+
@log.debug "#{cmd} path => #{cmdpath}"
|
96
|
+
@log.info "Start #{cmd}.".center(60,"*")
|
97
|
+
|
98
|
+
@log.debug("#{cmd} >> #{cmdpath} 2>/dev/null &")
|
99
|
+
@sess.exec!("#{cmd} >> #{cmdpath} 2>/dev/null &")
|
100
|
+
|
101
|
+
@pids[cmd]=@sess.exec!("echo $!")
|
102
|
+
@log.debug("#{cmd} pid => #{@pids[:ku]}")
|
103
|
+
end
|
104
|
+
|
105
|
+
def stop!
|
106
|
+
@pids.each do |key,value|
|
107
|
+
@sess.exec!("kill -9 #{value}")
|
108
|
+
@log.info("#{key} => #{value} stop!")
|
109
|
+
end
|
110
|
+
|
111
|
+
# if other user exec the same cmd,
|
112
|
+
# below cmd will kill all of the cmd.
|
113
|
+
|
114
|
+
# @sess.exec!(%q@ps axf|grep while|grep -v grep|awk '{printf "%s\n",$1}'|xargs kill -9@)
|
115
|
+
#
|
116
|
+
# @cmd.each { |e|
|
117
|
+
# @sess.exec!(%q@ps axf|grep "#{e}"|grep -v grep|awk '{printf "%s\n",$1}'|xargs kill -9@)
|
118
|
+
# }
|
119
|
+
|
120
|
+
@log.debug @server
|
121
|
+
@log.info("Monitor STOP!".center(60,"*"))
|
122
|
+
end
|
123
|
+
|
124
|
+
def collect
|
125
|
+
@log.debug "mkdir -p #{@path}/#{@server}"
|
126
|
+
%x{mkdir -p #{@path}/#{@server}}
|
127
|
+
|
128
|
+
path = @path.gsub('~',`echo ~`.gsub(/[\r\n]/,''))
|
129
|
+
@log.info "Collecting...".center(60,"*")
|
130
|
+
@log.debug "collect path => #{path}/#{@server}"
|
131
|
+
`scp -r admin@#{@server}:#{@rpath} #{path}/#{@server}`
|
132
|
+
@log.info "collected files => #{Dir[path+'/'+@server+'/**/*'].join($/)}"
|
133
|
+
end
|
134
|
+
|
135
|
+
#-----------------------------monit method--------------------------------#
|
136
|
+
|
137
|
+
def self.monit(servers,log,cmd=['ifstat','iostat 3','while((1>0));do sar -u -d 3 10; done','vmstat 3','while((1>0));do sar -u -n DEV 3 10; done'],ts="PerformanceTest")
|
138
|
+
|
139
|
+
case servers
|
140
|
+
when Hash
|
141
|
+
# do nothing
|
142
|
+
when String
|
143
|
+
File.open( servers ) { |yf|
|
144
|
+
begin
|
145
|
+
servers=YAML::load( yf )
|
146
|
+
rescue Exception => e
|
147
|
+
log.error("Servers' config YAML Load Error!Plz check your yaml file => #{servers}.#{$/}#{e.to_s}")
|
148
|
+
exit 1
|
149
|
+
end
|
150
|
+
}
|
151
|
+
end
|
152
|
+
|
153
|
+
_servers = {}
|
154
|
+
|
155
|
+
servers.each do |ip,obj|
|
156
|
+
_servers[ip] = RoadRunnerModule::RRMonitor.new({:server=>ip, :log=>log, :username=>obj[:username], :password=>obj[:password], :ts=>obj[:obj]||ts})
|
157
|
+
|
158
|
+
_servers[ip].run! cmd
|
159
|
+
end
|
160
|
+
|
161
|
+
yield
|
162
|
+
|
163
|
+
_servers.each do |k,v|
|
164
|
+
v.stop!
|
165
|
+
v.collect
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
173
|
+
|
174
|
+
|
data/lib/run.rb
CHANGED
@@ -8,42 +8,81 @@ module RoadRunnerModule
|
|
8
8
|
@thread_pool = {}
|
9
9
|
@counter = 0
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
@log.debug "Mode => #{@mode}"
|
12
|
+
iterationBlk = case @mode
|
13
|
+
when /thread/,/t/ then
|
14
|
+
proc {
|
15
15
|
@users.times do |userId|
|
16
|
-
@
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
@thread_pool[Thread.start(){
|
17
|
+
@iterations.times do |iterationId|
|
18
|
+
rcost = self.transaction('Action',&@actBlk)
|
19
|
+
self.log.debug "IterationID is #{self.iterationId};UserID is #{self.userId};This Action Cost #{rcost} seconds"
|
20
|
+
@longest = (@longest<rcost)?rcost:@longest
|
21
|
+
@thread_pool[Thread.current][:iterationId] = iterationId
|
22
|
+
end
|
23
|
+
@counter += 1
|
24
|
+
}]={:userId=>userId}
|
22
25
|
end
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
# @thread_pool.keys.each{|t|t.join}
|
27
|
+
while @counter != @users do
|
28
|
+
Thread.pass
|
29
|
+
end
|
30
|
+
}
|
31
|
+
when /process/,/p/ then
|
32
|
+
proc {
|
33
|
+
ppid=Process.pid
|
34
|
+
@log.info("Main Process pid => #{ppid}")
|
35
|
+
|
36
|
+
pids=[]
|
37
|
+
@users.times { |userId|
|
38
|
+
pids << Process.fork {
|
39
|
+
@userId=userId
|
40
|
+
@iterations.times do |iterationId|
|
41
|
+
@iterationId=iterationId
|
42
|
+
rcost = self.transaction('Action',&@actBlk)
|
43
|
+
@longest = (@longest<rcost)?rcost:@longest
|
44
|
+
end
|
45
|
+
@log.info("<PID:#{Process.pid}> going down.Longest job cost #{@longest}")
|
46
|
+
|
47
|
+
Process.kill("HUP", ppid)
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
switch=true
|
52
|
+
c=0
|
53
|
+
Signal.trap("HUP", proc { @log.info("One User(Process) done."); (switch = false;p "Main process<#{Process.pid}> going down.") if ((c+=1) == @users) })
|
54
|
+
|
55
|
+
@log.info "Waiting Processes => #{pids.inspect}"
|
56
|
+
|
57
|
+
p "Processes<#{pids.inspect}> working."
|
58
|
+
while switch
|
59
|
+
STDOUT.puts '.'
|
60
|
+
sleep 5
|
61
|
+
end
|
62
|
+
p $/
|
63
|
+
|
64
|
+
Process.waitall
|
65
|
+
@log.info "Processes down."
|
66
|
+
}
|
67
|
+
else
|
68
|
+
proc {
|
69
|
+
@iterations.times do |iterationId|
|
70
|
+
@iterationId=iterationId
|
71
|
+
@users.times do |userId|
|
72
|
+
@userId=userId
|
29
73
|
rcost = self.transaction('Action',&@actBlk)
|
30
|
-
|
74
|
+
# => the below sentence cost a lot of system resource
|
75
|
+
# => if you run for production result,keep it annotated!!!
|
76
|
+
# self.log.debug "IterationID is #{self.iterationId};UserID is #{self.userId};This Action Cost #{rcost} seconds"
|
31
77
|
@longest = (@longest<rcost)?rcost:@longest
|
32
|
-
@thread_pool[Thread.current][:iterationId] = iterationId
|
33
78
|
end
|
34
|
-
|
35
|
-
}]={:userId=>userId}
|
36
|
-
end
|
37
|
-
# @thread_pool.keys.each{|t|t.join}
|
38
|
-
while @counter != @users do
|
39
|
-
Thread.pass
|
40
|
-
end
|
79
|
+
end
|
41
80
|
}
|
42
81
|
end
|
43
82
|
|
44
83
|
p ' '+"RoadRunner".center(50, '*')
|
45
|
-
p ' *'+"---Run , on your way.".rjust(
|
46
|
-
p ' *'*
|
84
|
+
p ' *'+"---Run , on your way.".rjust(48, ' ')+'*'
|
85
|
+
p ' '+'*'*50
|
47
86
|
p
|
48
87
|
p " Running......"
|
49
88
|
@rep = Benchmark::measure(&iterationBlk)
|
data/log/dd.log
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
dd 50mb start
|
2
|
+
dd 50mb start
|
3
|
+
dd 50mb start
|
4
|
+
|
5
|
+
dd if=/dev/zero of=./nbd_perf_test_file_612eb7fd-c817-4203-9ee7-567db65e5fae.dat bs=512k count=102
|
6
|
+
sync
|
7
|
+
START:1266895933,END:1266896097,SPEND:164
|
8
|
+
|
9
|
+
|
10
|
+
rm dd document start
|
11
|
+
|
12
|
+
dd if=/dev/zero of=./nbd_perf_test_file_f16c2c97-c75c-496b-b9fd-e6f29b42f123.dat bs=512k count=102
|
13
|
+
sync
|
14
|
+
START:1266895933,END:1266896251,SPEND:318
|
15
|
+
|
16
|
+
|
17
|
+
rm dd document start
|
18
|
+
|
19
|
+
rm -rf dd_tmp_f9c1f5a6-6721-420a-b186-bc16d40e0d47
|
20
|
+
sync
|
21
|
+
START:1266896251,END:1266896388,SPEND:137
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
dd if=/dev/zero of=./nbd_perf_test_file_984b4f07-86e8-43f1-a0c1-000672519a32.dat bs=512k count=102
|
26
|
+
sync
|
27
|
+
START:1266895933,END:1266896388,SPEND:455
|
28
|
+
|
29
|
+
|
30
|
+
rm dd document start
|
31
|
+
dd 50mb start
|
32
|
+
|
33
|
+
rm -rf dd_tmp_bd42c07c-59ca-4082-9c77-292c0d63e56e
|
34
|
+
sync
|
35
|
+
START:1266896097,END:1266896388,SPEND:291
|
36
|
+
|
37
|
+
|
38
|
+
dd 50mb start
|
39
|
+
|
40
|
+
rm -rf dd_tmp_b4d4ff24-a1f1-4f52-aa81-c59d3a6abb0c
|
41
|
+
sync
|
42
|
+
START:1266896388,END:1266896692,SPEND:304
|
43
|
+
|
44
|
+
|
45
|
+
dd 50mb start
|
46
|
+
|
47
|
+
dd if=/dev/zero of=./nbd_perf_test_file_c1f1714e-077a-46e7-b95c-c371d75a5b5b.dat bs=512k count=102
|
48
|
+
sync
|
49
|
+
START:1266896388,END:1266896692,SPEND:304
|
50
|
+
|
51
|
+
|
52
|
+
rm dd document start
|
53
|
+
|
54
|
+
rm -rf dd_tmp_273ae817-fc22-4ca0-b5ad-0d458ba6a602
|
55
|
+
sync
|
56
|
+
START:1266896692,END:1266896710,SPEND:18
|
57
|
+
|
58
|
+
|
59
|
+
dd 50mb start
|
60
|
+
|
61
|
+
dd if=/dev/zero of=./nbd_perf_test_file_4b7f13b6-9627-41e2-a39f-7bfeba2da865.dat bs=512k count=102
|
62
|
+
sync
|
63
|
+
START:1266896388,END:1266896992,SPEND:604
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
dd if=/dev/zero of=./nbd_perf_test_file_a0a41b4f-83a6-4494-b3b1-f0a3401d7aed.dat bs=512k count=102
|
68
|
+
sync
|
69
|
+
START:1266896710,END:1266896992,SPEND:282
|
70
|
+
|
71
|
+
|
72
|
+
rm dd document start
|
73
|
+
rm dd document start
|
74
|
+
|
75
|
+
dd if=/dev/zero of=./nbd_perf_test_file_a42539c7-95cf-4764-9091-9aef95bf05e5.dat bs=512k count=102
|
76
|
+
sync
|
77
|
+
START:1266896692,END:1266896992,SPEND:300
|
78
|
+
|
79
|
+
|
80
|
+
rm dd document start
|
81
|
+
|
82
|
+
rm -rf dd_tmp_37815f72-f8eb-4e3f-9d6d-5ed47744976d
|
83
|
+
sync
|
84
|
+
START:1266896992,END:1266896993,SPEND:1
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
rm -rf dd_tmp_e15d6bfd-8946-40d9-8ee3-b8c7d0535734
|
89
|
+
sync
|
90
|
+
START:1266896992,END:1266896993,SPEND:1
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
rm -rf dd_tmp_b323674e-653e-47e4-97a1-4943930d894b
|
95
|
+
sync
|
96
|
+
START:1266896992,END:1266896993,SPEND:1
|
97
|
+
|
98
|
+
|
99
|
+
DD-Performance Total START:1266895933,END:1266896993,SPEND:1060
|
100
|
+
dd 50mb start
|
101
|
+
dd 50mb start
|
102
|
+
|
103
|
+
dd if=/dev/zero of=./nbd_perf_test_file_efc5672a-b42a-47fe-862f-82561d375800.dat bs=512k count=102
|
104
|
+
sync
|
105
|
+
START:1266896993,END:1266897300,SPEND:307
|
106
|
+
|
107
|
+
|
108
|
+
rm dd document start
|
109
|
+
|
110
|
+
dd if=/dev/zero of=./nbd_perf_test_file_6e473dcc-8d18-4fad-b655-005d36667ff3.dat bs=512k count=102
|
111
|
+
sync
|
112
|
+
START:1266896993,END:1266897300,SPEND:307
|
113
|
+
|
114
|
+
|
115
|
+
rm dd document start
|
116
|
+
|
117
|
+
rm -rf dd_tmp_71a917a3-d7de-413b-bef4-e6f298be6a0d
|
118
|
+
sync
|
119
|
+
START:1266897300,END:1266897300,SPEND:0
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
rm -rf dd_tmp_74236bfd-68d8-4f07-8a9e-129628819936
|
124
|
+
sync
|
125
|
+
START:1266897300,END:1266897300,SPEND:0
|
126
|
+
|
127
|
+
|
128
|
+
DD-Performance Total START:1266895933,END:1266897300,SPEND:1367
|
129
|
+
DD-Performance Total START:1266895933,END:1266897300,SPEND:1367
|