perf test optimization - part1

RevBy: Dmitry Rozenshtein
pull/1/head
Thyagarajan Balakrishnan 14 years ago
parent b2b373bd12
commit 0a432bd1c7

1
debian/changelog vendored

@ -10,6 +10,7 @@ applauncherd (3.0.1) unstable; urgency=low
* Changes: Fix python broken pipe randomly happened for Popen * Changes: Fix python broken pipe randomly happened for Popen
* Changes: Correct file path and dir path for applications started by booster-m * Changes: Correct file path and dir path for applications started by booster-m
* Changes: performance tests are run 5 times; 3 consistent values are considered * Changes: performance tests are run 5 times; 3 consistent values are considered
* Changes: performance test optimization part1
-- Alexey Shilov <alexey.shilov@nokia.com> Mon, 14 Nov 2011 13:39:38 +0200 -- Alexey Shilov <alexey.shilov@nokia.com> Mon, 14 Nov 2011 13:39:38 +0200

@ -7,6 +7,7 @@
<set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -16,6 +17,9 @@
<post_steps> <post_steps>
<step>cp /tmp/fala_wl.log /tmp/cmdline_fala_wl.log</step> <step>cp /tmp/fala_wl.log /tmp/cmdline_fala_wl.log</step>
<!-- starting applifed commented as it is started in the next set's post-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
-->
</post_steps> </post_steps>
<environments> <environments>
@ -32,6 +36,9 @@
<set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<!-- stopping applifed commented as it is stopped in the previous set's pre-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
-->
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -41,6 +48,7 @@
<post_steps> <post_steps>
<step>cp /tmp/fala_wl.log /tmp/grid_fala_wl.log</step> <step>cp /tmp/fala_wl.log /tmp/grid_fala_wl.log</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
</post_steps> </post_steps>

@ -7,6 +7,7 @@
<set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -16,6 +17,9 @@
<post_steps> <post_steps>
<step>cp /tmp/fala_qml_wl.log /tmp/cmdline_fala_qml_wl.log</step> <step>cp /tmp/fala_qml_wl.log /tmp/cmdline_fala_qml_wl.log</step>
<!-- starting applifed commented as it is started in the next set's post-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
-->
</post_steps> </post_steps>
<environments> <environments>
@ -32,6 +36,9 @@
<set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<!-- stopping applifed commented as it is stopped in the previous set's pre-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
-->
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -41,6 +48,7 @@
<post_steps> <post_steps>
<step>cp /tmp/fala_qml_wl.log /tmp/grid_fala_qml_wl.log</step> <step>cp /tmp/fala_qml_wl.log /tmp/grid_fala_qml_wl.log</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
</post_steps> </post_steps>
<!-- /QML --> <!-- /QML -->

@ -7,6 +7,7 @@
<set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-command-line" description="Application startup time from command line" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -16,12 +17,14 @@
<case name="Perf-Test-Command-QML-plain" type="Performance" description="Measure startup time of the qml application without launcher" timeout="500" level="System" insignificant="false"> <case name="Perf-Test-Command-QML-plain" type="Performance" description="Measure startup time of the qml application without launcher" timeout="500" level="System" insignificant="false">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_qml_wol -b fala_qml_wol -f "/tmp/fala_qml_wol.log" &gt; /tmp/perf_commandline_qml_without_launcher.txt</step> <step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_qml_wol -b fala_qml_wol -f "/tmp/fala_qml_wol.log" &gt; /tmp/perf_commandline_qml_without_launcher.txt</step>
</case> </case>
<post_steps> <post_steps>
<step>cp /tmp/fala_wol.log /tmp/cmdline_fala_wol.log</step> <step>cp /tmp/fala_wol.log /tmp/cmdline_fala_wol.log</step>
<step>cp /tmp/fala_qml_wol.log /tmp/cmdline_fala_qml_wol.log</step> <step>cp /tmp/fala_qml_wol.log /tmp/cmdline_fala_qml_wol.log</step>
<!-- starting applifed commented as it is started in the next set's post-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
-->
</post_steps> </post_steps>
<environments> <environments>
@ -40,6 +43,9 @@
<set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195"> <set name="test-applicationGrid" description="Application startup time from application grid" feature="AF DUI Booster for Launcher daemon" requirement="300195">
<pre_steps> <pre_steps>
<!-- stopping applifed commented as it is stopped in the previous set's pre-step
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_applifed</step>
-->
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step> <step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps> </pre_steps>
@ -54,6 +60,7 @@
<post_steps> <post_steps>
<step>cp /tmp/fala_wol.log /tmp/grid_fala_wol.log</step> <step>cp /tmp/fala_wol.log /tmp/grid_fala_wol.log</step>
<step>cp /tmp/fala_qml_wol.log /tmp/grid_fala_qml_wol.log</step> <step>cp /tmp/fala_qml_wol.log /tmp/grid_fala_qml_wol.log</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
</post_steps> </post_steps>
<!-- /QML --> <!-- /QML -->

@ -134,33 +134,27 @@ end
sleep(2) sleep(2)
#run loop 4 times (4 seconds) if @meegoHome.test_object_exists?(:text => appName)
4.times do icon = @meegoHome.SwipeLauncherButton(:text => appName)
if @meegoHome.test_object_exists?(:text => appName)
icon = @meegoHome.SwipeLauncherButton(:text => appName)
while icon.attribute('visibleOnScreen') == 'false' || icon.attribute('y').to_i > 400
@meegoHome.SwipePannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 350)
sleep(0.2)
icon.refresh
end
xpos = @meegoHome.SwipeLauncherButton(:text => appName).attribute('x')
xpos = xpos.to_i + 59
ypos = @meegoHome.SwipeLauncherButton(:text => appName).attribute('y')
ypos = ypos.to_i + 58
@pos = "#{xpos}x#{ypos}"
puts @pos
exit 0 #exit gracefully
end
sleep(1) while icon.attribute('visibleOnScreen') == 'false' || icon.attribute('y').to_i > 400
@meegoHome.SwipePannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 350)
sleep(0.2)
icon.refresh
end
xpos = @meegoHome.SwipeLauncherButton(:text => appName).attribute('x')
xpos = xpos.to_i + 59
ypos = @meegoHome.SwipeLauncherButton(:text => appName).attribute('y')
ypos = ypos.to_i + 58
@pos = "#{xpos}x#{ypos}"
puts @pos
exit 0 #exit gracefully
else
#icon does not exist
#raise error and exit
puts "app not found"
raise "Application not found in Application grid"
exit 1
end end
#icon does not exist
#raise error and exit
puts "app not found"
raise "Application not found in Application grid"
exit 1

@ -74,6 +74,16 @@ class daemon_handling (unittest.TestCase):
def start_daemons(self): def start_daemons(self):
start_daemons() start_daemons()
def stop_applifed(self):
os.system("initctl stop xsession/applifed")
def start_applifed(self):
os.system("initctl start xsession/applifed")
#applifed start causes booster-m to be used to prestart applications.
#camera has the least priority and the last one to be prestarted.hence
#we wait for the camera to be up and running so that any more booster-m is not used up
wait_for_app('camera-ui')
def has_GL_context(processId, tries=2): def has_GL_context(processId, tries=2):
for i in range(tries): for i in range(tries):
processMapsFile = open("/proc/" + processId + "/maps") processMapsFile = open("/proc/" + processId + "/maps")

@ -48,7 +48,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
$path = string = `echo $PATH ` $path = string = `echo $PATH `
def print_debug(msg) def print_debug(msg)
message = "[INFO] #{msg}\n" message = "[INFO] [#{Time.now.to_f}] #{msg}\n"
puts message puts message
end end
@ -111,7 +111,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
options = {} options = {}
# Set a banner, displayed at the top # Set a banner, displayed at the top
# of the help screen. # of the help screen.
opts.banner = "Usage: get-coordinates.rb [options] " opts.banner = "Usage: test-perf.rb [options] "
options[:application] = nil options[:application] = nil
opts.on( '-a', '--application APP', 'Application name in application grid' ) do|app| opts.on( '-a', '--application APP', 'Application name in application grid' ) do|app|
@ -201,10 +201,12 @@ class TC_PerformanceTests < Test::Unit::TestCase
system "mcetool --set-inhibit-mode=stay-on" system "mcetool --set-inhibit-mode=stay-on"
end end
print_debug("restart mthome") #print_debug("restart mthome")
system("initctl restart xsession/mthome") #system("initctl restart xsession/mthome")
print_debug("stop applifed")
system("initctl stop xsession/applifed") #applifed stop/start moved test xml
#print_debug("stop applifed")
#system("initctl stop xsession/applifed")
print_debug("move #{MATTI_LOCATION} to #{TEMPORARY_MATTI_LOCATION}") print_debug("move #{MATTI_LOCATION} to #{TEMPORARY_MATTI_LOCATION}")
system "mv #{MATTI_LOCATION} #{TEMPORARY_MATTI_LOCATION}" system "mv #{MATTI_LOCATION} #{TEMPORARY_MATTI_LOCATION}"
@ -227,39 +229,39 @@ class TC_PerformanceTests < Test::Unit::TestCase
end end
# method called after any test case for cleanup purposes # method called after any test case for cleanup purposes
def teardown def teardown
print_debug ("exit from teardown") print_debug ("exit from teardown")
print_debug("move #{TEMPORARY_MATTI_LOCATION} to #{MATTI_LOCATION}") print_debug("move #{TEMPORARY_MATTI_LOCATION} to #{MATTI_LOCATION}")
system "mv #{TEMPORARY_MATTI_LOCATION} #{MATTI_LOCATION}" system "mv #{TEMPORARY_MATTI_LOCATION} #{MATTI_LOCATION}"
if @options[:application] != nil #if @options[:application] != nil
print_debug("restart mthome") # print_debug("restart mthome")
system("initctl restart xsession/mthome") # system("initctl restart xsession/mthome")
sleep(10) # sleep(10)
end #end
if not system "pgrep applauncherd" #if not system "pgrep applauncherd"
system("initctl start xsession/applauncherd") # system("initctl start xsession/applauncherd")
end #end
if not system "pgrep applifed"
system("initctl start xsession/applifed") #applifed stop/start moved test xml
#if not system "pgrep applifed"
# system("initctl start xsession/applifed")
#applifed start causes booster-m to be used to prestart applications. #applifed start causes booster-m to be used to prestart applications.
#Camera has the least priority and the last one to be prestarted.Hence #camera has the least priority and the last one to be prestarted.hence
#We wait for the camera to be up and running so that any more booster-m is not used up #we wait for the camera to be up and running so that any more booster-m is not used up
wait_for_app('camera-ui') # wait_for_app('camera-ui')
end #end
wait_for_app('applauncherd') #wait_for_app('applauncherd')
wait_for_app('booster-q') #wait_for_app('booster-q')
wait_for_app('booster-e') #wait_for_app('booster-e')
wait_for_app('booster-d') #wait_for_app('booster-d')
wait_for_app('booster-m') #wait_for_app('booster-m')
end end
def open_Apps(appName) def open_Apps()
# Remove the log files if they exist # Remove the log files if they exist
if FileTest.exists?(PIXELCHANGED_LOG) if FileTest.exists?(PIXELCHANGED_LOG)
print_debug("remove #{PIXELCHANGED_LOG}") print_debug("remove #{PIXELCHANGED_LOG}")
@ -337,7 +339,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
def read_file(appName) def read_file()
def get_matching_lines(lines, re) def get_matching_lines(lines, re)
# return a list of lines that match re # return a list of lines that match re
lines.collect { |x| if x[1] =~ re; x; else; nil; end }.compact lines.collect { |x| if x[1] =~ re; x; else; nil; end }.compact
@ -441,19 +443,10 @@ class TC_PerformanceTests < Test::Unit::TestCase
print_debug("Kill #{PIXELCHANGED_BINARY} if any before launching ") print_debug("Kill #{PIXELCHANGED_BINARY} if any before launching ")
system("pkill #{PIXELCHANGED_BINARY}") system("pkill #{PIXELCHANGED_BINARY}")
open_Apps(@options[:application]) open_Apps()
read_file()
sleep (5) app_cache_list.push(@app_from_cache) if @options[:appCache] != nil
win_cache_list.push(@win_from_cache) if @options[:winCache] != nil
read_file(@options[:application])
if @options[:appCache] != nil
app_cache_list.push(@app_from_cache)
end
if @options[:winCache] != nil
win_cache_list.push(@win_from_cache)
end
delay = @end_time - @start_time - MCOMPOSITOR_XGRABSERVER_DELAY_CONSTANT delay = @end_time - @start_time - MCOMPOSITOR_XGRABSERVER_DELAY_CONSTANT
#start_time_sum += delay #start_time_sum += delay

Loading…
Cancel
Save