Simple Website Traffic Statistics tool

Source: Internet
Author: User
Tags current time redis
Simple Website Traffic Statistics tool

Of course, talking about the website traffic statistics, now open source also have, free also has, XX statistics, XX statistics, online casually can find, individual reason writes this tool, completely out of personal preference, as a "occupation" yards nong, in yards Nong's path also walked a few years, think oneself a little thing only, of course, write bad , source listen to advice, do not spray. background

To say the background, in addition to their own want to write something, but really a bit of background, before the company to do a project, the project after the big revision, do the pilot, since the pilot, certainly to statistics user use situation, so access to the buried point system, as for what system, here do not say, can say only: foreigners do, Estimated n years ago, the results of the statistics are almost the next day to be out. Of course, our project on the statistics of real-time requirements are not high, so, no problem. But as a program ape with so ness in the Internet environment, how can it tolerate such a slow system of real-time, so that individuals have the idea of writing this system. As for good, go with him, personal preference. Project Architecture

Talk about the project structure, but also really embarrassed to use the word architecture, because in my mind, the structure is generally very good system will have a system architecture design, I this system, a few, not architecture, so can only say the structure;
Structure, is also very simple, can be divided into three layers (also in line with the MVC structure): V, using highcharts to do statistical report display. C,springmvc,m, in order to be more efficient, we chose Redis for data storage.
The statistics are shown in real time, but the report only counts the 15 days before the current time. System Use Framework

From the above description, it is basically clear the framework used by the system: Highcharts+jquery+bootstrap+springmvc+redis system function statistics website PV volume. Statistics page button clicks. Count the number of clicks on the page link. Count the number of active users per day. Statistics of daily active User IP distribution and so on. Test Data screenshot button Statistic item configuration

PV Statistics item configuration

button click Statistics Results

Link Click Statistics Results

PV Volume Statistics results

User Activity Statistics Results

user access to IP distribution (only domestic IP conditions)

Performance

As a statistical site, the Department of Energy should be the most important, but too bad, because the individual only a four or five years ago notebook, do stress testing is too poor, so the performance of the system did not test. Hope interested friends can test the test, the younger brother is greatly appreciated. access Mode

If this tool is unfortunate enough for you to look at, want to try, feel honored, you can continue looking down.
Because the function is relatively simple, the access method is also very simple:
1. Deploy the system to your server and configure the stats you need in the configuration menu.
2. Copy the commoncount.js in the project to a directory where you need to do the embedding.
3. Modify the BaseURL value in Commoncount.js and modify it to your project path.
4. Introduce the commoncount.js into the page where you need to do the burying point.
5. Add the corresponding statistic method to the OnClick event of the button, link, etc. that need statistic, PV statistic is added on onload. PostScript

If you feel that this tool is useful to you and want to introduce you to your project, you can do it yourself two times, or contact me to do enhancements.

Project Address: Https://github.com/itboyspg/spg-code/tree/master/countView

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.