开发者

how to calculate the PV,ip,PU according to the tomcat log

开发者 https://www.devze.com 2023-02-11 14:38 出处:网络
how to calculate the PV,ip,PU according to the tomcat log? I have export the tomcat log to db. Something about the db st开发者_开发问答ructure can be found here.

how to calculate the PV,ip,PU according to the tomcat log?

I have export the tomcat log to db.

Something about the db st开发者_开发问答ructure can be found here.

For the ip I can use:

select count(distinct ip)...

But how about the pv and pu?

I have no idea,please do me a favor if you know.


Something like

SELECT 
    COUNT(SELECT DISTINCT ip from tblName) AS IPs, 
    COUNT(SELECT DISTINCT uri from tblName) AS UniquePages, 
    COUNT(SELECT DISTINCT username from tblName) as UniqueVisitors from tblName;

should work for you


To limit what type of pages should be counted, add that to the sub-query

SELECT 
    COUNT(SELECT DISTINCT ip from tblName) AS IPs, 
    COUNT(SELECT DISTINCT uri from tblName WHERE uri NOT LIKE '%.js' AND uri NOT LIKE '.css') AS UniquePages, 
    COUNT(SELECT DISTINCT username from tblName) as UniqueVisitors from tblName;
0

精彩评论

暂无评论...
验证码 换一张
取 消