Calculating Network Latency

Post Reply
mjacobson
Posts: 204
Joined: Fri Feb 08, 2002 3:35 pm

Calculating Network Latency

Post by mjacobson »

Is there a way with vortex to calculate the network latency while fetching Urls?

I have tried:
<sysinfo proctime><$startTime = $ret>
<fetch $Url>
<sysinfo proctime $startTime><$totalTime = $ret>
<loop SKIP=2 $totalTime><$Latency = $totalTime></loop>
<$Latency=($Latency/2)>

While this seems to work, at times, it gives me really high values, "15.003459" for $Latency.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Calculating Network Latency

Post by John »

You can use <urlinfo totaltime> <urlinfo dnstime> and <urlinfo transfertime> to get times. Sometimes if a nameserver is down it may take 15 seconds before trying DNS again.
John Turnbull
Thunderstone Software
mjacobson
Posts: 204
Joined: Fri Feb 08, 2002 3:35 pm

Calculating Network Latency

Post by mjacobson »

Thanks. I don't know how I missed reading about these urlinfo flags. Transfertime seems to be what I need.

I do have another question concerning redirects and <urlinfo header "Date">. When I fetch a page that is on one server (www.somesite.com) and get redirected to a different server (www.newserver.com), which header am I getting the Date value from?

Also, is there a way with vortex to get just the server's header without making a http request with fetch for a document on that server? I need to write a script that retrives the servers date so we can see if it is in sync with a time server. I want to keep bandwidth and network load down as much as possible.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Calculating Network Latency

Post by John »

You should be getting the date from the last URL fetched, which has the actual content.

You can use <SUBMIT METHOD=HEAD URL=http://SOMESITE/> which should just fetch the headers, and not the content, assuming that the webserver supports HEAD (most do).
John Turnbull
Thunderstone Software
Post Reply