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