These are time-stamps, right? And if so you surely don't mean "response"
and "request" in that order i.e. each request time-stamp is *after* the
corresponding response?! Are the values being taken from the same "clock"?
If not, do you know the offset of one from the other?
Making the obvious adjustment, it will be true that the sum of all response
time-stamps less the sum of all request stamps divided by the total number
of transactions will be the average anyway - you don't need to match them up
individually. If you have different numbers of requests and responses, your
data is useless unless you have some way of identifying the unmatched values
e.g. chucking time-stamps that are obviously from the afternoon iso the
morning (or whatever).
HTH, GStC.
PS: this is a statistical problem, not a Perl one 8-)
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Monday, August 08, 2005 4:21 PM
Subject: Data comparison algorythm
Hello All
I have a rather difficult problem I am trying to solve.
I have two arrays with a series of request times and response times for
some network communication (UDP-SNMP communications). The data is such
that I cannot accurately state what response coincides with what request
and there can be less responses then requests.
For example:
Response Times:
1123522351.49722
1123522351.49724
1123522351.49727
1123522351.49730
1123522351.51042
1123522351.60701
Request Times:
1123522351.50794
1123522351.50868
1123522351.50968
1123522351.54463
1123522351.60934
I need to try and determine the avg. response time for all of the
request/responses. Now given that there is no accurate way to determine
what response lines up with what request, I need to do some guessing here.
Looking at the lists, it would appear that the 1st
3 responses do line up with the 1st 3 requests and the 4th response time
appears to line up with the 5th request. So, estimating it would appear
that the 4th request was not answered (a possibility as the communication
is UDP so there is no guarantee of delivery).
My question is this, how can I attempt to ascertain what the avg response
time is using 'best guesses'?
The way I have it now, is that I compare each index of the array to the
coinciding index of the other array. If the response times is a neg.
value, I throw it out and if the response time is too high (over 5 secs) I
throw it out. This is obvisouly not the best way.
Anyone have any ideas on how I can solve this problem? There is no
additional details I can use in the source data so I am limited in that
aspect.
Thanks!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>