English 中文(简体)
确定网站的会期
原标题:Determining session time for a website

For one of my classes we need to calculate the session length for a user visiting a website. We were given a web log. The web log is in this format:

IPAddress date httpMethod httpStatus size referrer browserInfo 
  • The httpMethod looks like this: GET /include/main_page.css HTTP/1.1
  • The referrer is always the main page: http://www.cs.myCollage.com or -

我用20分钟的时间表示。

QUESTIONS: I am not sure how to tell when a session is over other than when it times out. Is the only way to end a session with a timeout? Is there a way to detect when a user leaves the site (using only the information in the logs)?


这是我目前的战略(假设我们有这些标志):

IPAddress    Time    httpMethod    ...
IP1          2:15    GET something
IP1          2:17    GET something else
IP1          2:30    GET something else
IP1          4:30    GET something else
IP1          4:32    GET something else

这意味着用户有两届会议。 我认为,第一届会议将<>要么15分钟,/strong>35分钟。 我是否应当把时间推到会议时间?

第二届会议时间为2分钟至22分钟。

最佳回答

时间分配数值用于区分来自同一知识产权的不同课程(不一定是同一人)。 例如,你有两场不同的会议,因为从2.30到4.30段时间大于时间价值。

至于确定会期长短,这或许是简单明了的班级家庭工作解决办法,或许是教师所铭记的:从结束时间起,时间就更短。 例15分钟,第二次2分钟。

如果这是一个真正的世界项目,那么每届会议的最后一页也应得到一定价值。 为此,你可以采用时地方法:

最后一个全球货币基金的期限可以按其之前的所有页的平均期限估算。 例如(2:15,2:17,2:30)头两页的长度为15分钟,因此估计访问者是慢慢和/或彻底的,第三页的长度为7.5分钟,会议时间为22.5分钟。 从(30,4:32)起,我们推测最后一页持续了2分钟,会议共4分钟。 在只有一页访问的特别情况下,你必须具有一定的任意价值,如一分钟。

另一种做法是给每一页带来价值。 有些网页比其他网页需要更多的时间阅读。 这意味着,你必须阅读整个记录,确定每页在届会中的平均访问时间,并在届会最后一页时使用这一时间。 这更加复杂,也许不能回答你的家务问题。

最好的真正世界解决办法可能是这两种办法的组合。

问题回答

暂无回答




相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...