FileMetrics reduction function computes a single telemetry stream representing project size information.
Table 28.10.
| Parameter | Description | Default |
|---|---|---|
| fileType | The type of file to be included in computation. You can use a wildcard '*' to include all file types. Or you can supply a value that corresponds to the actual file type in your 'FileMetric' sensor data, such as 'Java', 'C', 'Perl'. | * |
| sizeMetricsName | The size metrics name. This is a value that corresponds to the actual metrics name in your 'FileMetric' sensor data, such as 'totalLines', 'classCount', 'functionCount', 'commentLines', 'numFiles'. | totalLines |
| filePattern | Ant-like file pattern specifying the files to be included in computation. | ** |
Example 28.14. Filemetric
streams JavaFileMetricStream(filePattern) = {
"Java SLOC",
FileMetric("Java", "sourceLines", filePattern)
};
y-axis yAxis(label) = {label};
chart JavaFileMetricChart(filePattern) = {
"Java Size in SLOC",
(JavaFileMetricStream(filePattern), yAxis("SLOC"))
};
draw JavaFileMetricChart("**");

This chart shows the number of source lines in all Java files in the project.
Example 28.15. Filemetric
streams JavaFileMetricStream(filePattern, metricName) = {
"Java SLOC",
FileMetric("Java", metricName, filePattern)
};
y-axis yAxis(label) = {label};
chart JavaFileMetricChart(filePattern) = {
"Java Size in Classes, Methods, SLOC",
(JavaFileMetricStream(filePattern, "classCount"), yAxis("Classes")),
(JavaFileMetricStream(filePattern, "functionCount"), yAxis("Methods")),
(JavaFileMetricStream(filePattern, "sourceLines"), yAxis("SLOC"))
};
draw JavaFileMetricChart("**");

This chart contains three telemetry streams. One for the number of source lines in all Java files, one for the number of all Java methods, and the final one for the number of Java classes in the project.