STATSVN is a good statistical tool that can help you to count team members ' respective writing volume, number of codes, submission status, number of documents, etc., and publish statistical results as HTML page charts.
Previously wrote a small program called Nova, and Statsvn management, through this example to introduce some of the functions of STATSVN
The above is the home page of the published report, which mainly describes the start and end time of the statistics, and the statistics of the lines of code, etc. (it is said that the number of lines of code including blank lines of code, not verified)
Then you can look at some of the individual programmer's scenarios
Statistics on the monthly compilation, submission, code modification as a percentage of the total number of code
Which hours of the day are more active
The days of the week are more active.
Submit Log
Number of files statistics
Average number of file rows statistics
The file type of the statistic, and how much the file is sorted by the number of lines of code
The file is sorted by version number (number of modifications).
Some statistics of the folder, there is a catalog chart need to install Java because the system has just re-installed Java does not show the ~
Agitation, the length of the blue bar indicates that the more modified at some time
Usage Prerequisites
STATSVN's homepage: http://www.statsvn.org/
It is a 2M jar file, which is the SVN statistical tool, and the statistical results are saved in HTML format. So, if you want to publish results for team members to browse, need a server (or PC, seemingly nonsense ...) ), install the Web server (apache2, etc.), need jvav (clerical error is Java) environment, install at least SVN client, in order to get the latest version on the SVN servers. APACHE2,JAVA,SVN installation here does not do a detailed introduction (online information relatively complete).
How to use
Download Statsvn.jar
Use the SVN client to get the latest version of the code on the SVN server, such as the following commands on Linux:
12 |
#check out 最新版本 svn co http: //xxxx .xxxxx.xxxxx /xxxxx |
To generate a new version of the log log:
12 |
#生成项目SVN日志 svn log - v --xml > 日志名XXX.log |
In the directory where the statistics result HTML is stored, execute Statsvn.jar, a simple example:
12 |
#简单例子 java -jar .. /statsvn .jar .. /nova/ 日志名XXX.log .. /nova -charset utf-8 -disable-twitter-button -title Nova -include **/*.cpp:**/*.h -exclude ** /sqlite3/ *.* |
Java-jar. /statsvn.jar executes Statsvn.jar, followed by its arguments
Parameter 1:.. /nova/Log name XXX.log call the SVN log generated above
Parameter 2:.. /nova the latest version is in the same directory
Parameter 3:-charset GB2312 The character set used for the generated HTML
Parameter 4:-disable-twitter-button Close the Twitter connection, perhaps the STATSVN developer is a Twitter enthusiast, statsvn by default after the project and the developer's name, add a Twitter connection button to facilitate interaction. This does not work in China, we all know ... So let the Twitter connect button not show.
Parameter 5:-title title Name This setting displays the title of the item in the HTML page
The parameter 6:-include **/*.cpp:**/*.h represents the file type of the statistic, by default statsvn all files under the specified directory (including some auto-generated files of the development environment, this parameter can be set to specify statistical specific files, The example shows only the CPP and H files in the project directory.
The parameter 7:-exclude **/sqlite3/*.* represents the content that is not counted, the parameter in the example indicates that the contents of the Sqlite3 in the project folder are not counted (because the content of sqlite3 is called by someone else to write the program, statistics in no sense ~)
This is the most commonly used parameters of STATSVN, other more detailed parameters can refer to the official website introduction.
Extended Use methods
Since STATSVN is static and needs to be executed once to see the new results, we can let him do it regularly in the system, such as 2:00 every night, and then the next day you can see all the stats from last night.
Take the Linux system as an example
We can get a new version of the above, generate the log, generate the statistics of the process is written as sh file, and named "Task name. Sh"
123456789 |
#!/bin/sh
cd ~
cd statsvn
svn co http:
//192
.168.5.32
/nova
cd nova
svn log -
v --xml > svn.log
cd ..
cd novalog
java -jar ..
/statsvn
.jar ..
/nova/svn
.log ..
/nova
-charset utf-8 -disable-twitter-button -title Nova -include **/*.cpp:**/*.h -exclude **
/sqlite3/
*.*
|
Then use the Crontab Timer task tool to perform timed execution of this sh (crontab setting method can refer to the Internet)
1234 |
[email protected]:~$ crontab -l # m h dom mon dow command 0 2 * * * /home/o/statsvn/ 任务名.sh [email protected]:~$ |
The directory where the generated HTML results reside is soft-connected to the root directory of Apache (e.g. "www" folder) and can be accessed using Web pages.
STATSVN small concise and practical, is a good team management tools, but in early 2010 released to version 0.7.0 did not update, do not know if it is rotten tail ... It's too bad
http://my.oschina.net/myriads/blog/15665
Go SVN's Visual log Statistics tool STATSVN