Author: tmckay
Date: 2011-02-08 14:38:05 +0000 (Tue, 08 Feb 2011)
New Revision: 4506
Modified:
branches/scale_testing/mech_scripts/test.py
branches/scale_testing/mech_scripts/test_driver.py
Log:
Extend link files with cache_control notation so that links
can be skipped to emulate caching behavior.
Modified: branches/scale_testing/mech_scripts/test.py
===================================================================
--- branches/scale_testing/mech_scripts/test.py 2011-02-07 16:44:47 UTC (rev 4505)
+++ branches/scale_testing/mech_scripts/test.py 2011-02-08 14:38:05 UTC (rev 4506)
@@ -51,7 +51,7 @@
os.system("python process_times.py " + subdir + " --csvfile="
+ sys.argv[3] + " --threads=" + threads)
- shutil.copyfile("./config.cfg.save", config)
+ shutil.copyfile("./.config.cfg.save", config)
if __name__ == '__main__':
main()
Modified: branches/scale_testing/mech_scripts/test_driver.py
===================================================================
--- branches/scale_testing/mech_scripts/test_driver.py 2011-02-07 16:44:47 UTC (rev 4505)
+++ branches/scale_testing/mech_scripts/test_driver.py 2011-02-08 14:38:05 UTC (rev 4506)
@@ -85,11 +85,13 @@
parser.add_option('--file', dest='file',
type='str', default="./links")
parser.add_option('--iter', dest='iter',
type='int', default=1)
parser.add_option('--info', dest='info',
action="store_true", default=False)
+ parser.add_option('--noskip', dest='skip',
action="store_false", default=True)
# combine these to create an output file name for web server internal
stats
parser.add_option('--group', dest='group',
type='str', default="headers")
parser.add_option('--thread', dest='thread',
type='str', default="")
parser.add_option('--outdir', dest='outdir',
type='str', default=".")
+
if type(self.script_options) == str:
self.script_options = self.script_options.split()
@@ -100,6 +102,7 @@
self.link_file = os.path.abspath(opts.file)
self.iteration_limit = opts.iter
self.print_info = opts.info
+ self.skip = opts.skip
self.group = opts.group
self.thread = opts.thread
self.outdir = opts.outdir
@@ -122,13 +125,25 @@
link_info = link.split(',')
# Check for initial Boolean, indicates whether "If_Modified"
header was used
- if len(link_info) == 2:
- if_modified_header = link_info[0] = "True"
+ if len(link_info) == 3:
+ # Newest file type. If_Modified header, then Cache-Control
+ if_modified_header = link_info[0] == "True"
+ cache_control = link_info[1] == "True"
+ link = link_info[2].strip()
+ elif len(link_info) == 2:
+ if_modified_header = link_info[0] == "True"
+ cache_control = False
link = link_info[1].strip()
else:
if_modified_header = True
+ cache_control = False
link = link_info[0].strip()
-
+
+ # Skip cached pages if skip flag is set, let's us see times for
+ # only the dynamic pages
+ if self.skip and cache_control:
+ continue
+
time_for_get = time_time()
conn = httplib.HTTPConnection(self.machine)
if link in self.visited and self.visited[link] and if_modified_header:
@@ -166,7 +181,10 @@
# Record some custom stuff
self.custom_timers['Page File'] = get_latency
- self.custom_timers['Avg Get'] = get_latency / total_gets
+ if total_gets == 0:
+ self.custom_timers['Avg Get'] = 0
+ else:
+ self.custom_timers['Avg Get'] = get_latency / total_gets
self.stand_alone_stats['Total Gets'] = total_gets
self.stand_alone_stats['Total Size kb'] = total_size / 1024.0
Show replies by date