Previous Topic: Custom Report MetricsNext Topic: Deploy a New Report Metric


Create a New Report Metric

When a test case is staged, a subsystem within DevTest samples metric values. DevTest then reports them in the ways that are defined in the staging document. The staging document includes the metrics to be collected. Users can also add them as the test runs.

Two classes must be created for the metric collection:

Follow these steps:

  1. Create a Java class that implements com.itko.lisa.stats.MetricIntegration.

    This class provides the metrics that you want to access during the staging of a test.

    public class RandomizerMetricIntegration implements MetricIntegration
    {
     
    }
    
  2. Implement the required getTypeName method.

    This method that provides the name that is used to identify the custom report metric type in the Staging Document Editor.

    public String getTypeName()
    {
        return "Randomizer Metric";
    }
    
  3. Implement the public MetricCollector[] addNewCollectors(Component parent) method so that at design time your code can define the requested metrics to be collected.
  4. Create a Java class that extends com.itko.lisa.stats.MetricCollector.

    DevTest calls on instances of this class to collect the requested metrics. The class must also implement Serializable.

    public class RandomMetricCollector extends MetricCollector implements java.io.Serializable
    {
     
    }
    
  5. Complete the implementation of your MetricIntegration and MetricCollector objects.

    See the JavaDocs in the doc folder of your installation directory for those classes and the sample code for RandomizerMetricIntegration and RandomMetricCollector for more information about the individual methods available to extend.