Current time: 12-16-2017, 01:19 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Test ID in UA?
01-07-2016, 07:26 AM (This post was last modified: 01-07-2016 08:00 AM by rviscomi.)
Post: #1
Lightbulb Test ID in UA?
So I know that test agents append PTST to the UA, which is useful for identifying WPT in server logs. I wonder if it's feasible to do something along those lines to give servers a backlink to the test results. What I had in mind was if the test agents knew the ID and run number of the test, that data could be included in the UA as well. A link to the corresponding test results page could be reconstructed from the server logs.

My use case is a monitoring service that schedules tests automatically using the API. Instead of getting the ID from the API and querying for the results, I'd like to use my existing RUM pipeline to log the perf metrics. So if the UA of the test machine was logged by the RUM service, conceivably I'd be able to get back to the WPT test results page for any particular test run.

There are actually three pieces of information needed to reconstruct the test results URL: test ID, run number, and first/repeat view.

So for example we could append the following to a UA string: "PTST/160106_ZT_13T3-r:3-c:0" which would correspond with these results: http://www.webpagetest.org/result/160106...3/details/

This could either be added by default just like PTST or enabled in the custom UA setting as a template value, like "PTST/{{test_id}}-r:{{run_number}}-c:{{repeat_view}}". The test agent would substitute the placeholders accordingly. I think it'd be easier to do by default, but the template option adds more versatility.

WDYT?

Filed https://github.com/WPO-Foundation/webpag...issues/548

Rick Viscomi
Author, Using WebPageTest
http://usingwpt.com
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2016, 02:26 AM
Post: #2
RE: Test ID in UA?
Done. It is api-only and you specify how you want the string formatted.

i.e. something like keepua=1&appendua=PTST/%TESTID%-r:%RUN%-c:%CACHED% would give you the UA string above (properly urlencoded when submitting). The keepua=1 would be needed if you want to modify the PTST string. If you just want to append something else you can leave that there.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2016, 06:28 AM
Post: #3
RE: Test ID in UA?
Thanks for the quick fix! I sent https://github.com/WPO-Foundation/webpagetest/pull/549 to add support for these params on the home page.

Rick Viscomi
Author, Using WebPageTest
http://usingwpt.com
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)