You need not reverse the list for counting requests per second.
If the data is in sorted order, you can start with any direction.
Take the first as the base and keep separating untill you get 1 second or X 
units like 1000 milliseconds if your data is in milliseconds.
The count would be an item of the list and now your base changes to 
timestamp where you ended.

But looking at the little data you provided it seems it is not sorted.

If it is not sorted, one quick solution you can try is like binary search 
tree, where each node counts the no-requests-from-T-to-T+1
BST would be useful if the data is sparse like a lot of time server is not 
used and then used continuously.
Otherwise instead of bst, you can store the info in array too, faster 
access time.

On Thursday, 17 July 2014 18:19:12 UTC+5:30, empt...@gmail.com wrote:
>
> Hi, 
>
> I have a list of epoch times which map to HTTP requests. 
>
> '(1405060202611
> 1405060201157
> 1405060201361
> 1405060201261
> 1405060200391
> 1405060201458
> 1405060201705
> 1405060201058
> 1405060205062
> 1405060201558
> 1405060201761
> ....)
>
> I am trying to find out how many HTTP requests I have in a specified time 
> period, so I can graph requests per second.
>
> I was thinking of using reverse and subtracting the first from the list 
> from the second and recurring, which would give me the time period between 
> every two requests - which is a start.
>
> Any help appreciated here. 
>
> Many Thanks
>
> Aidy
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to