Skip to main content

Create a New KPI in a Test Run

This Eggplant Performance Analyzer REST method creates a new Key Performance Indicator (KPI) in a test run. You use the following URL with a POST HTTP method as described here.

URL

/analyzer/api/1.0/<workspace>/<project>/<series>/<test>/<run number>/create_kpi

You can use this URL with a POST method as described here.

HTTP Method

POST: Creates a KPI in a test run.

Request Parameters

ParameterTypeDescription
namestringThe name of the new KPI.
operandstringThe operand to use for the new KPI. Possible values are <= and >=.
targetnumberThe target value of the new KPI.
categorystringThe category of the new KPI.
statTypestringThe statistic type of the new KPI.
chartAxisSeriesTypestringThe series type of the new KPI.
summaryStatTypestringThe summary statistic type of the new KPI.
bucketCountnumberThe number of buckets to use when calculating the data. By default it will use the default number of buckets, which is usually 100.
measurementNamestringThe measurement name for the new KPI. (Only required if category is System Under Test or Measurements.)
serieslist of stringsThe series against which the KPI will be applied.

Response Parameters

ParameterTypeDescription
<KPI name>stringThe URL of the newly created KPI.

Example Request

http://localhost:5000/analyzer/api/1.0/Workspace%201/Project%201/Series%201/Test%201/1/create_kpi
POST Data
{
"name": "Max transaction rate should be greater than 10",
"operand": ">=",
"target": 10.0,
"category": "Transactions",
"statType": "Rate",
"chartAxisSeriesType": "Timing",
"summaryStatType": "Maximum",
"series": ["<COMBINED>"]
}

Example Response

{
"Max transaction rate should be greater than 10": "http://localhost:5000/analyzer/api/1.0/Workspace%201/Project%201/Series%201/Test%201/1/kpis/Max%20transaction%20rate%20should%20be%20greater%20than%2010"
}