0
点赞
收藏
分享

微信扫一扫

4.受访分析


受访分析
========================================================================================================================================================================================================================================================================

--各页面访问统计
各页面PV

select * from dw_weblog_detail limit 10;
+-------------------------+-------------------------------+-------------------------------+------------------------------+--------------------------+---------------------------+-------------------------+-----------------------+------------------------+-----------------------------------------------+--------------------------+-----------------------------------+------------------------------------------------+----------------------------+-------------------------------+-----------------------------+--------------------------------+----------------------------------------------------+---------------------------+--+
| dw_weblog_detail.valid | dw_weblog_detail.remote_addr | dw_weblog_detail.remote_user | dw_weblog_detail.time_local | dw_weblog_detail.daystr | dw_weblog_detail.timestr | dw_weblog_detail.month | dw_weblog_detail.day | dw_weblog_detail.hour | dw_weblog_detail.request | dw_weblog_detail.status | dw_weblog_detail.body_bytes_sent | dw_weblog_detail.http_referer | dw_weblog_detail.ref_host | dw_weblog_detail.ref_path | dw_weblog_detail.ref_query | dw_weblog_detail.ref_query_id | dw_weblog_detail.http_user_agent | dw_weblog_detail.datestr |
+-------------------------+-------------------------------+-------------------------------+------------------------------+--------------------------+---------------------------+-------------------------+-----------------------+------------------------+-----------------------------------------------+--------------------------+-----------------------------------+------------------------------------------------+----------------------------+-------------------------------+-----------------------------+--------------------------------+----------------------------------------------------+---------------------------+--+
| false | 194.237.142.21 | - | 2018-11-01 06:49:18 | 2018-11-01 | 06:49:18 | 11 | 01 | 06 | /wp-content/uploads/2013/07/rstudio-git3.png | 304 | 0 | "-" | NULL | NULL | NULL | NULL | "Mozilla/4.0(compatible;)" | 20181101 |
| false | 163.177.71.12 | - | 2018-11-01 06:49:33 | 2018-11-01 | 06:49:33 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 163.177.71.12 | - | 2018-11-01 06:49:36 | 2018-11-01 | 06:49:36 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 101.226.68.137 | - | 2018-11-01 06:49:42 | 2018-11-01 | 06:49:42 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 101.226.68.137 | - | 2018-11-01 06:49:45 | 2018-11-01 | 06:49:45 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 60.208.6.156 | - | 2018-11-01 06:49:48 | 2018-11-01 | 06:49:48 | 11 | 01 | 06 | /wp-content/uploads/2013/07/rcassandra.png | 200 | 185524 | "http://cos.name/category/software/packages/" | cos.name | /category/software/packages/ | NULL | NULL | "Mozilla/5.0(WindowsNT6.1)AppleWebKit/537.36(KHTML,likeGecko)Chrome/29.0.1547.66Safari/537.36" | 20181101 |
| false | 222.68.172.190 | - | 2018-11-01 06:49:57 | 2018-11-01 | 06:49:57 | 11 | 01 | 06 | /images/my.jpg | 200 | 19939 | "http://www.angularjs.cn/A00n" | www.angularjs.cn | /A00n | NULL | NULL | "Mozilla/5.0(WindowsNT6.1)AppleWebKit/537.36(KHTML,likeGecko)Chrome/29.0.1547.66Safari/537.36" | 20181101 |
| false | 183.195.232.138 | - | 2018-11-01 06:50:16 | 2018-11-01 | 06:50:16 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 183.195.232.138 | - | 2018-11-01 06:50:16 | 2018-11-01 | 06:50:16 | 11 | 01 | 06 | / | 200 | 20 | "-" | NULL | NULL | NULL | NULL | "DNSPod-Monitor/1.0" | 20181101 |
| false | 66.249.66.84 | - | 2018-11-01 06:50:28 | 2018-11-01 | 06:50:28 | 11 | 01 | 06 | /page/6/ | 200 | 27777 | "-" | NULL | NULL | NULL | NULL | "Mozilla/5.0(compatible;Googlebot/2.1;+http://www.google.com/bot.html)" | 20181101 |
+-------------------------+-------------------------------+-------------------------------+------------------------------+--------------------------+---------------------------+-------------------------+-----------------------+------------------------+-----------------------------------------------+--------------------------+-----------------------------------+------------------------------------------------+----------------------------+-------------------------------+-----------------------------+--------------------------------+----------------------------------------------------+---------------------------+--+


select request,count(request) as request_counts
from dw_weblog_detail
group by request having request is not null
order by request_counts desc limit 20;(这种方式)
+----------------------------------------------------+-----------------+--+
| request | request_counts |
+----------------------------------------------------+-----------------+--+
| / | 6278 |
| /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 | 722 |
| /wp-includes/js/jquery/jquery.js?ver=1.10.2 | 716 |
| /js/baidu.js | 636 |
| /wp-admin/admin-ajax.php | 616 |
| /js/google.js | 616 |
| /wp-content/themes/silesia/js/jquery.cycle.all.min.js | 586 |
| /wp-content/themes/silesia/functions/js/shortcode.js | 580 |
| /wp-content/themes/silesia/js/load.js | 580 |
| /wp-includes/js/comment-reply.min.js?ver=3.6 | 570 |
| /feed/ | 526 |
| /wp-content/themes/silesia/style.css | 510 |
| /wp-content/themes/silesia/functions/css/shortcodes.css | 508 |
| /wp-content/themes/silesia/images/slide-bg.png | 476 |
| /wp-content/themes/silesia/images/natty-logo.png | 476 |
| /wp-content/themes/silesia/images/crubms-div.png | 476 |
| /wp-content/themes/silesia/images/ico-twitter.png | 472 |
| /wp-content/themes/silesia/images/home-ico.png | 472 |
| /wp-content/themes/silesia/images/ico-meta.gif | 470 |
| /wp-content/themes/silesia/images/sprites/post-type.png | 466 |
+----------------------------------------------------+-----------------+--+
20 rows selected (63.34 seconds)

--热门页面统计
统计每日最热门的页面top10
drop table dw_hotpages_everyday;

create table dw_hotpages_everyday(day string,url string,pvs string);

insert into table dw_hotpages_everyday
select '20181101',a.request,a.request_counts from
(select request as request,count(request) as request_counts
from dw_weblog_detail
where datestr='20181101'
group by request having request is not null
order by request_counts desc) a
limit 10;

select * from dw_hotpages_everyday limit 10;
+---------------------------+----------------------------------------------------+---------------------------+--+
| dw_hotpages_everyday.day | dw_hotpages_everyday.url | dw_hotpages_everyday.pvs |
+---------------------------+----------------------------------------------------+---------------------------+--+
| 20181101 | /wp-includes/js/comment-reply.min.js?ver=3.6 | 570 |
| 20181101 | /wp-content/themes/silesia/js/load.js | 580 |
| 20181101 | /wp-content/themes/silesia/functions/js/shortcode.js | 580 |
| 20181101 | /wp-content/themes/silesia/js/jquery.cycle.all.min.js | 586 |
| 20181101 | /js/google.js | 616 |
| 20181101 | /wp-admin/admin-ajax.php | 616 |
| 20181101 | /js/baidu.js | 636 |
| 20181101 | /wp-includes/js/jquery/jquery.js?ver=1.10.2 | 716 |
| 20181101 | /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 | 722 |
| 20181101 | / | 6278 |
+---------------------------+----------------------------------------------------+---------------------------+--+

另一种方式(注意顺序)
drop table dw_hotpages_everyday;
create table dw_hotpages_everyday(day string,url string,pvs string);

insert into table dw_hotpages_everyday
select '20181101',a.request,a.request_counts from
(select request as request,count(request) as request_counts from dw_weblog_detail where datestr='20181101' group by request having request is not null) a
order by a.request_counts desc limit 10;

select * from dw_hotpages_everyday limit 10;
+---------------------------+----------------------------------------------------+---------------------------+--+
| dw_hotpages_everyday.day | dw_hotpages_everyday.url | dw_hotpages_everyday.pvs |
+---------------------------+----------------------------------------------------+---------------------------+--+
| 20181101 | / | 6278 |
| 20181101 | /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 | 722 |
| 20181101 | /wp-includes/js/jquery/jquery.js?ver=1.10.2 | 716 |
| 20181101 | /js/baidu.js | 636 |
| 20181101 | /wp-admin/admin-ajax.php | 616 |
| 20181101 | /js/google.js | 616 |
| 20181101 | /wp-content/themes/silesia/js/jquery.cycle.all.min.js | 586 |
| 20181101 | /wp-content/themes/silesia/functions/js/shortcode.js | 580 |
| 20181101 | /wp-content/themes/silesia/js/load.js | 580 |
| 20181101 | /wp-includes/js/comment-reply.min.js?ver=3.6 | 570 |
+---------------------------+----------------------------------------------------+---------------------------+--+

 

举报

相关推荐

4. AQS

4.线程

4. Hystrix

4.查询二

4.数组dddd

4.检索数据

0 条评论