Administration du serveur > Workflow and SCM Projects > Using Configuration Management Project Metrics
  
Using Configuration Management Project Metrics
You can track metrics for top-level configuration management projects and calculate them through event triggers. Calculated metrics can be viewed for a configuration management project or through a computed field on a workflow and document project item. Metrics provide information on a project as of a specific checkpoint.
Windchill RV&S provides some standard physical metrics you can use. You can also create your own metrics using a third party tool.
Metrics Included With Windchill RV&S
Windchill RV&S provides the following metrics:
physical lines
number of characters in text files
number of bytes in binary files
number of revisions in archives
number of normal members
number of subproject members
number of checkpoints
number of java source files
number of binary files
number of text files
number of C or CPP files
largest number of members in any subproject
largest number of subprojects in any subproject
These metrics are calculated by the following event triggers:
check in
checkpoint
add member
Metric calculations generated by operations in subprojects are automatically rolled up to the parent project.
Tracking Project Metrics
If you decide to track metrics for a project that has already been checkpointed, you can calculate metrics for existing checkpoints using the Calculate Project Metrics command in the GUI or the si calculateprojectmetrics command in the CLI.
Viewing Project Metrics
You can view the calculated metrics for a project in the Project Metrics view or through the si viewmetricsinfo CLI command.
You can also view calculated metrics in the workflow and document project item that is associated with the configuration management project. The workflow and document project item must have an si project data type field that links it to the configuration management project and a computed field that displays the metric calculations that you want to view. For example, if you want to see the number of members in an configuration management project in the corresponding workflow and document project item, you would create a Number of Members field with the following expression:
SIMetric("siproject-name","Number of Members")
You could checkpoint the configuration management project nightly and update the build revision encoded in the si project field; so any changes in the number of members would be reflected in the workflow and document project item.
Using Third Party Metrics Tool
You can use a third party tool to track additional configuration management metrics. Metrics tracked by a third party tool must be defined in Windchill RV&S and recorded for a specific project checkpoint. You define a metric by specifying a name and description for it using the si createmetricinfo CLI command. To define a metric you need the Metrics permission.
You can use a third party tool to calculate metrics for Java. For example, you can use a tool such as JavaNCSS1 to calculate the number of Java source files in a project. You need to write a script to add the metrics calculated by a third party tool to a specific project checkpoint. For more information on creating a script for metrics, see the comments in the sample script metrics.js. You can update this file by adding your file suffix to one of the tables and creating a new JavaScript function to implement the metrics.
* 
If you run custom Java code from a script, your custom Java code can be put into the installdir/data/java/classes directory as individual class files or packaged as one or more JAR files in the installdir/data/java/jars directory. You can use both directories at the same time if you want some classes packaged up and some exposed individually.
You can use a third party tool to calculate metrics for C or C++ in the context of a Sandbox. You add the calculated value of the metric to a project checkpoint using the si addprojectmetric CLI command. For more information on the CLI commands see the Pages de manuel de la CLI.
Performance With Metrics
There may be a performance impact when using project metrics. The first time you checkpoint a project with a large number of members that existed before implementing metrics, the metric calculation may take a significant amount of time. The increase in time is due to the need for the metrics to be initially computed for the pre-existing members, while subsequent metric calculations are aggregated for members of the project.

1 JavaNCSS is supported but not shipped with Windchill RV&S.