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分钟。