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: 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 test optimization part1
-- 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">
<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>
</pre_steps>
@ -16,6 +17,9 @@
<post_steps>
<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>
<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">
<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>
</pre_steps>
@ -41,6 +48,7 @@
<post_steps>
<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>

@ -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">
<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>
</pre_steps>
@ -16,6 +17,9 @@
<post_steps>
<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>
<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">
<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>
</pre_steps>
@ -41,6 +48,7 @@
<post_steps>
<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>
<!-- /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">
<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>
</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">
<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>
<post_steps>
<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>
<!-- 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>
<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">
<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>
</pre_steps>
@ -54,6 +60,7 @@
<post_steps>
<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>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_applifed</step>
</post_steps>
<!-- /QML -->

@ -134,8 +134,6 @@ end
sleep(2)
#run loop 4 times (4 seconds)
4.times do
if @meegoHome.test_object_exists?(:text => appName)
icon = @meegoHome.SwipeLauncherButton(:text => appName)
@ -152,15 +150,11 @@ sleep(2)
puts @pos
exit 0 #exit gracefully
end
sleep(1)
end
else
#icon does not exist
#raise error and exit
puts "app not found"
raise "Application not found in Application grid"
exit 1
end

@ -74,6 +74,16 @@ class daemon_handling (unittest.TestCase):
def start_daemons(self):
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):
for i in range(tries):
processMapsFile = open("/proc/" + processId + "/maps")

@ -48,7 +48,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
$path = string = `echo $PATH `
def print_debug(msg)
message = "[INFO] #{msg}\n"
message = "[INFO] [#{Time.now.to_f}] #{msg}\n"
puts message
end
@ -111,7 +111,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
options = {}
# Set a banner, displayed at the top
# of the help screen.
opts.banner = "Usage: get-coordinates.rb [options] "
opts.banner = "Usage: test-perf.rb [options] "
options[:application] = nil
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"
end
print_debug("restart mthome")
system("initctl restart xsession/mthome")
print_debug("stop applifed")
system("initctl stop xsession/applifed")
#print_debug("restart mthome")
#system("initctl restart xsession/mthome")
#applifed stop/start moved test xml
#print_debug("stop applifed")
#system("initctl stop xsession/applifed")
print_debug("move #{MATTI_LOCATION} to #{TEMPORARY_MATTI_LOCATION}")
system "mv #{MATTI_LOCATION} #{TEMPORARY_MATTI_LOCATION}"
@ -227,39 +229,39 @@ class TC_PerformanceTests < Test::Unit::TestCase
end
# method called after any test case for cleanup purposes
def teardown
print_debug ("exit from teardown")
print_debug("move #{TEMPORARY_MATTI_LOCATION} to #{MATTI_LOCATION}")
system "mv #{TEMPORARY_MATTI_LOCATION} #{MATTI_LOCATION}"
if @options[:application] != nil
print_debug("restart mthome")
system("initctl restart xsession/mthome")
sleep(10)
end
if not system "pgrep applauncherd"
system("initctl start xsession/applauncherd")
end
if not system "pgrep applifed"
system("initctl start xsession/applifed")
#if @options[:application] != nil
# print_debug("restart mthome")
# system("initctl restart xsession/mthome")
# sleep(10)
#end
#if not system "pgrep applauncherd"
# system("initctl start xsession/applauncherd")
#end
#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.
#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')
end
wait_for_app('applauncherd')
wait_for_app('booster-q')
wait_for_app('booster-e')
wait_for_app('booster-d')
wait_for_app('booster-m')
#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')
#end
#wait_for_app('applauncherd')
#wait_for_app('booster-q')
#wait_for_app('booster-e')
#wait_for_app('booster-d')
#wait_for_app('booster-m')
end
def open_Apps(appName)
def open_Apps()
# Remove the log files if they exist
if FileTest.exists?(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)
# return a list of lines that match re
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 ")
system("pkill #{PIXELCHANGED_BINARY}")
open_Apps(@options[:application])
sleep (5)
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
open_Apps()
read_file()
app_cache_list.push(@app_from_cache) if @options[:appCache] != nil
win_cache_list.push(@win_from_cache) if @options[:winCache] != nil
delay = @end_time - @start_time - MCOMPOSITOR_XGRABSERVER_DELAY_CONSTANT
#start_time_sum += delay

Loading…
Cancel
Save