Test Process Monitor - tpm_add

Purpose

Use the Test Process Monitor tool (tpm_add) to create and update Test Process Monitor databases from a command line.

Syntax

tpm_add -metric= <metric> [-file=<filename>] [-user=<user>] {[<value_field>]}

where:

  • <metric> is the name of the metric.

  • <filename > contains the name of the file under test to which the metric applies. This allows metrics for several files to be saved within the same database.

  • <user> is the name of the product user who performed the measured value.

  • <value_field> are the values attributed to each field

Description

The Test Process Monitor (TPM) provides an integrated monitoring feature that helps project managers and test engineers obtain a statistical analysis of the progress of their development effort.

Metrics generated by a test or runtime analysis feature are stored in their own database. Each database is actually a three-dimensional table containing:

  • Fields: Each database contains a fixed number of fields. For example a typical Code Coverage database records.

  • Values: Each field contains a series of values.

  • Filenames: Values can be attributed to a filename, such as the name of the file under analysis. This way, the TPM Viewer can display result graphs for any single filename as well as for all files, allowing detailed statistical analysis.

Each field contains a set of values.

Note Although you specify a filename for the file under analysis, the TPM Viewer currently only displays a unique FileID number for each file.

The TPM database is made of two files that use the following naming convention:

<metric> . <user> . <nb_fields>.idx

<metric> . <user> . <nb_fields>.tpm

where <nb_fields> is the number of fields contained in the database.

In the GUI, the Test Process Monitor gathers the statistical data from these database file and generates a graphical chart based on each field.

There are 3 steps to using TPM:

  • Creating a database for the metric

  • Updating the database

  • Viewing the results in the GUI

Creating a Database

Before opening the Test Process Monitor in the product, you must create a database.

Database files are created by using the tpm_add command line tool.

If you are using Code Coverage from the GUI, it automatically creates and updates a TPM code-coverage database.

If you are using the product in the command line interface you can invoke tpm_add from your own scripts.

To create a new metric database with tpm_add:

  1. Type the following command:

tpm_add -metric=<name> -file=<filename> <value1>[ {<value2>... }]

where <name> is the name of the new metric and <value> represents the initial value of each field in the database. <filename> is the name of the source file to which these values are related.

Updating a Database

The Test Process Monitor adds a record to the database each time it encounters an existing database.

To add a new record to this database:

  1. Type the tpm_add command:

tpm_add -metric=<name> <value1>[ {<value2>... }]

where <name> is the name of the new metric and <value> represents the initial value of each field in the database. The number of values must be the consistent with the number of fields in the table.

Note It is important to remain consistent and supply the correct number of fields for your database. If you run the tpm_add command on an existing metric, but with a different number of fields, the feature creates a new database.

tpm_add -metric=stats 5 -6 5.4 3 0

Viewing TPM Reports

Use the Test Process Monitor menu in the product to display database. Please refer to the User Guide for further information.

Examples

The following command creates a user metric called stats, made up of five fields, containing initial values 1, 0.03, 0, 3 and -4.7.

tpm_add -metric=stats -file=/project/src/myapp.c 1 0.03 0 3 -4.7

The new database is contained in the following files:

stats.user.5.idx

stats.user.5.tpm

The following line adds a new record to the stats database, pertaining to the myapp.c source file:

tpm_add -metric=stats -file=/project/src/myapp.c 5 -6 5.4 3 0

The following line adds a new set of values to the stats database, this time related to the mylib.c source file:

tpm_add -metric=stats -file=/project/src/mylib.c 5 -6 5.4 3 0

The metrics related to myapp.c and mylib.c are stored in the same database and can be viewed either jointly or separately in the product Test Process Monitor Viewer.

If the following command is issued:

tpm_add -metric=stats -file=myapp.c 5 -6 3 0

A new database is created with four fields:

stats.user.4.idx

stats.user.4.tpm