Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
Public Member Functions | List of all members
com.griddynamics.jagger.engine.e1.services.MetricService Interface Reference

Service gives an ability to create and describe metrics, save metric values. More...

Inheritance diagram for com.griddynamics.jagger.engine.e1.services.MetricService:
Inheritance graph
[legend]

Public Member Functions

void createMetric (MetricDescription metricDescription)
 Creates metric. More...
 
void flush ()
 Writes all values to file system. More...
 
void saveValue (String metricId, Number value)
 Saves metric value during test run. More...
 
void saveValue (String metricId, Number value, long timeStamp)
 Saves metric value with specific timestamp during test run. More...
 
- Public Member Functions inherited from com.griddynamics.jagger.engine.e1.services.JaggerService
boolean isAvailable ()
 Reports if service is available. More...
 

Detailed Description

Service gives an ability to create and describe metrics, save metric values.

Author
Gribov Kirill
Details:

Where this service is available you can find in chapter: Relation of listeners and Jagger services
Below is example of creating metric with metric service. MetricDescription is used to setup how metric will be aggregated and stored

Example - creating metric:
// begin: following section is used for docu generation - example of metric creation
// In this example, we will create custom metric to collect internal metrics of SUT
// Approach is the following:
// - Declare custom metric
// - Run test. SUT will usually collect some internal data (metrics)
// - After test is finished, get all internal data from SUT and save to custom metric
// In this case internal data will be save to result DB, displayed in test report and Web UI,
// you can use it in decision maker when running Continues Integration
MetricDescription metricDescription = new MetricDescription("internalData");
metricDescription.plotData(false).showSummary(true).addAggregator(new AvgMetricAggregatorProvider());
getMetricService().createMetric(metricDescription);
// end: following section is used for docu generation - example of metric creation

Example - saving metric:
// begin: following section is used for docu generation - example of metric saving
// Save metric
getMetricService().saveValue("internalData",someMetric);
// end: following section is used for docu generation - example of metric saving


Full example code you can find in chapter Custom listener examples code


The documentation for this interface was generated from the following file: