Optima KPI status

Optima provides a PUSH API that can be specified in the configuration file

/opt/ptv-optima-as/standalone/configuration/optima/optima-configuration.xml.

The customer can specify two lists of URLs.

The first list contains the list of URLs to which we send the information by provider.

The second list contains the list of URLs to which we send the information by simulation group.

<kpi-status-urls>
	<status-by-provider>
		<!--<url>URL_1</url>-->
		<!--<url>URL_2</url>-->
		<!--<url>URL....</url>-->
		<!--<url>URL_n</url>-->
	</status-by-provider>
	<status-by-simulation-group>
		<!--<url>URL_1</url>-->
		<!--<url>URL_2</url>-->	
		<!--<url>URL....</url>-->	
		<!--<url>URL_m</url>-->	
	</status-by-simulation-group>
</kpi-status-urls>
        

We send a message to the list of URLs prepared to receive the message by provider (<status-by-provider> tag) just after all the KPI instances are computed for a simulation: when provider=TRE and, for a specific run, when provider=harmonizer.

We send a message to the list of URLs prepared to receive the message by simulation group (<status-by-simulation-group> tag) just after all the KPI instances are computed for a given simulation group.

Optima sends via POST three types of payload messages.

The structure of the messages is composed of six distinct elements:

Parameter Required Description

provider

YES

String type.

It contains the provider name of a data provider.

In the table you can see the list of available providers:

Provider ID Provider Name

1

optima-put

2

short-term-forecast

3

optima-harmonizer

4

machine-learning-forecast-quality

5

optima-planning

6

optima-micro

7

machine-learning-forecast

computationTime

YES

String type.

It contains the timestamp associated to the final instant of the time period used by the provider for data production.

It is the same instant associated to the KPI result start time.

In case of a simulation-based provider, it is the same as the run start time.

In the case of a simulationGroup, it is the same as the last runs start time.

instant

YES

String type.

It contains the timestamp associated to the time used to produce the KPI message.

status

YES

String type.

Two possible values:

  • KPI_ERROR: if at least one KPI is not computed due to an error.
  • KPI_COMPUTE: if ALL KPIs are computed with success.

simulation

NO

Integer type.

Contains the value of the Simulation ID.

simulationGroup

NO

Integer type.

Contains the value of the Simulation ID.

Configuration of the ISO 8601 date format

You can configure a push request including a timestamp:

The option is handled through a string parameter associated with the tag <configuration>/<api-date-format> of the file /opt/ptv-optima-as/standalone/configuration/optima/optima-configuration.xml.

Property

Type

Description

api-date-format

String

It determines the timestamp format:

  • iso: the timestamp is in the format ISO 8601
  • legacy: otherwise

Important:  If api-date-format is not present in the optima-configuration.xml file, the legacy timestamp is enabled.

In the next examples, timestamps are indicated in ISO format.

POST payload by provider (not simulation based): example 1

"provider": "optima-harmonizer", 
"computationTime": "+52349-12-02T13:00:41+01:00", 
"instant": "2020-05-18T23:18:05.161+01:00", 
"status":"KPI_ERROR"
        

POST payload by provider (simulation based): example 2

"provider": "TRE"
"computationTime": "2020-05-14T23:02:06.469+01:00"
"instant": "2020-05-14T23:02:31.812+01:00"
"status": "KPI_COMPUTE"
"simulation": 172
        

POST payload by simulation group: example 3

"provider": "TRE"
"computationTime": "2020-05-14T23:02:06.469+01:00"
"instant": "2020-05-14T23:02:31.812+01:00"
"status": "KPI_COMPUTE"
"simulationGroup": 1