Current time: 10-23-2019, 12:12 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wpt_batch.py and custom connectivity
11-14-2012, 09:43 PM (This post was last modified: 11-14-2012 10:53 PM by andydavies.)
Post: #1
wpt_batch.py and custom connectivity
Hi Pat,

I'm trying to submit some batch jobs with custom connectivity profiles...

If I use the default profile everything is OK, but if I try to set a custom profile e.g.

Quote:python wpt_batch.py -u test_urls.txt -o Sydney:Chrome --connectivity=custom --bwup=384 --bwdown=2000 --latency=50 --plr=1 -k apikey -s http://www.webpagetest.org/ -r 1

I get

Code:
<bwDown>0</bwDown>
<bwUp>0</bwUp>
<latency>0</latency>
<plr>('1',)</plr>

A similar thing happens if I leave the --plr out

Code:
<bwDown>0</bwDown>
<bwUp>0</bwUp>
<latency>0</latency>
<plr>('0',)</plr>

Any ideas what I'm missing?

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
11-20-2012, 12:50 AM
Post: #2
RE: wpt_batch.py and custom connectivity
Any chance you can log the runtest.php url before it sends it out (or ping me and run it again so I can grab it from the access logs)?

Looking at the runtest.php code it looks like the bandwidth and latency params are extracted as ints and the plr is extracted as a string so the strange plr is probably happening to all of them and the int versions are just getting set to zero.

If I had to guess I would say that something on the python size is causing the test_params dictionary to encode the query params in a strange way but I'm not a big python guy so it may take me a little while to look into it.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-21-2012, 12:12 AM (This post was last modified: 11-21-2012 01:56 AM by andydavies.)
Post: #3
RE: wpt_batch.py and custom connectivity
Edit: Got time this week so dug into it and found the issue - guess no-one has used custom bandwidth with the batch submitter!

The URL being sent is:

Code:
http://www.webpagetest.org/runtest.php?bwIn=(2000,)&plr=(1,)&private=1&video=0&latency=(50,)&runs=1&f=xml&url=http://www.debenhams.com&k=apikey&priority=6&bwOut=(384,)&mv=1&location=Sydney:Chrome.custom&fvonly=1

The comma on the end of the following lines converts the value to a tuple

Code:
test_params['bwOut'] = options.bwup,
test_params['bwIn'] = options.bwdown,
test_params['latency'] = options.latency,
test_params['plr'] = options.plr,
test_params['location'] = options.location + '.custom'

Removing the commas i.e.

Code:
test_params['bwOut'] = options.bwup
test_params['bwIn'] = options.bwdown
test_params['latency'] = options.latency
test_params['plr'] = options.plr
test_params['location'] = options.location + '.custom'

Will give the correct query string values URL:

Code:
http://www.webpagetest.org/runtest.php?bwIn=2000&plr=1&private=1&video=0&latency=50&runs=1&f=xml&url=http://www.debenhams.com&k=apikey&priority=6&bwOut=384&mv=1&location=Sydney:Chrome.custom&fvonly=1

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
11-21-2012, 02:12 AM
Post: #4
RE: wpt_batch.py and custom connectivity
Awesome. Thanks for digging into it. I just pushed the fix.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)