STATSVN Introduction
STATSVN is the Java write Open source statistics program from Statcvs to porting. From the can subversion version number to obtain the information base, the project developed a descriptive description, and then generate a variety of tables and charts. Example: Time line. The number of lines of code for each developer, the level of developer activity, recent submissions by developers, number of documents, average file size, and maximum files. Which file is the maximum number of changes, folder size, repository tree with the number of files and the number of lines of code.
STATSVN the current version number can generate a set of static HTML documents that contain tables and graphs.
STATSVN Download
STARTSVN Official website address is: http://www.statsvn.org/index.html
The download page for STARTSVN is: http://www.statsvn.org/downloads.html
The latest version number on the official website is now: statsvn-0.7.0
STATSVN use
Notice of Use
The implementation of STATSVN requires Java's execution environment support. So you need to install Java Runtime environment. The JRE can be downloaded from the Sun's site.
STATSVN needs to use SVN's client in use, so make sure that the SVN client commands are available on the machine
Checkout Working Copy
First, checkout a required statistic path from the SVN repository (assuming that the statistics are in the working folder. First please update. Make sure that the version number in the workspace is the latest version number. Ensure the accuracy of the statistical results), such as I checkout the project under one of my paths to the D:\MyProjects path on my computer.
Generate SVN log file
First go to working folder via command line: D:\MyProjects, then use svn log-v--xml > Logfile.log command, logfile.log as log file name, can be defined according to the need.
This generates a file named Logfile.log under the folder of the working copy.
Note: To use the SVN command at the command line, you must choose to install the commend component when installing TORTOISESVN, and you can enter SVN help on the cmd command line to test if the component is installed. It is not possible to use the SVN log command if it is not installed.
Assuming that you can manipulate SVN server, you can generate SVN log directly on the server and download it locally.
call STATSVN for statistics
First we extract the Statsvn-0.7.0.zip package downloaded from the official website into the D:\statsvn-0.7.0 folder
Enter the D:\statsvn-0.7.0 folder from the command line
Call command Java-jar statsvn.jar D:\MyProjects\logfile.log D:\MyProjects, command execution completed the statistical work.
The format of the command is Java-jar Statsvn.jar [options] <logfile> <checked-out-module>
Parameters <logfile> The SVN log file generated in the previous step. <checked-out-module> Copy the folder for checkout work, note that the correct full path is listed for all two parameters, otherwise it will prompt for errors such as logfile.log not found, etc.
- <logfile> path to the SVN logfile of the module
- <directory> path to the directory of the checked out module
[Options] is an optional parameter, and the format and method of use for example are as follows:
- Some options:
- -version Print the version information and exit
- -output-dir <dir> directory where HTML suite would be saved
- -include <pattern> include only files matching pattern, e.g. * */*.c;**/*.h
- -exclude <pattern> exclude matching files, e.g. tests/**;d ocs/**
- -tags <regexp> Show matching tags in lines of code chart, e.g. version-.*
- -title <title> Project title to being used in reports
- -VIEWVC <url> integrate with VIEWVC installation at <url>
- -trac <url> integrate with Trac at <url>
- -bugzilla <url> integrate with Bugzilla installation at <url>
- -username <svnusername> Username-Pass to SVN
- -password <svnpassword> Password-pass to SVN
- -verbose Print Extra Progress information
- -xdoc Optional switch output to Xdoc
- -xml Optional switch output to XML
- -threads <int> How many threads for SVN diff (default: )
- -concurrency-threshold <millisec> Switch to concurrent SVN diff if 1st Call>threshol
- -dump dump the Repository content on console
- -charset <charset> Specify the charset to use for Html/xdoc
- -tags-dir <directory> Optional, specifies the director for tags (default '/tags/')
- Full options list:http://www.statsvn.org
1. Pilot out SVN log
svn log-v--xml-rstartrevision:endrevision > Svn.log local_project
2. Analysis with STATSVN tools
Java-jar Statsvn.jar Svn.log Local_project
After execution, the corresponding analysis files will be generated under $PWD (under Unix) or%cd% (under Windows), and there will be a code count in the index.html file.
#!/bin/bashsvn_dir= '/home/homer/work/code_svn/weiguan ' statsvn_dir= '/home/homer/work/tool-server/statsvn-0.7.0/ Statsvn.jar ' log_dir=svnstatlog_file= ' $log _dir/svnstat.log "log_day=" $log _dir/2014-01-01_00:00:00 "version_start= 4150version_end=4159function statsvn () { cd $svn _dir svn up if [!-D $log _dir];then mkdir $log _dir fi date=$ (date "+%y-%m-%d_%h:%m:%s") echo "$date" lines= ' Find-name *.java | xargs wc-l | sort-n '
echo "Total code lines: $lines" version_end= ' svn log-l1 | sed-n 2p | awk ' {print $} ' | cut-d "R"-f2 ' Echo "Version_start: $version _start; Version_end: $version _end " svn log-v--xml-r$version_start: $version _end > $log _file log_day=" $log _dir/ $date " java-jar $statsvn _dir $log _file.-output-dir $log _day >/dev/null 2>&1 google-chrome $log _ Day/index.html &}STATSVN
Recommended References:
STATSVN count the amount of code in SVN
How to count the amount of code on SVN-using the STATSVN tool
Statistical analysis of the number of code submitted by SVN users per day
An SVN-based code submission volume Statistics Tool
Statsvn
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
The amount of the SVN Code statistics tool