# Defining KPIs

While the optimization goal drives the Akamas AI toward optimal configurations, there might be other sub-optimal configurations of interest in case they do not simply match the optimization constraints but might also improve on some Key Performance Indicators (KPIs).

For example:

* for a Kubernetes microservice Java-based application, a typical optimization goal is to reduce the overall (infrastructure or cloud) cost by tuning both Kubernetes and JVM parameters while keeping SLOs in terms of application response time and error rate under control
* among different configurations that provide similar cost reduction in addition to matching all SLOs, a configuration that would also significantly cause the application response time might be worth considering with respect to an optimal configuration that does not improve on this KPI

Akamas automatically considers any metric referred to in the defined optimization goal and constraints for an offline optimization study as a **KPI**. Moreover, any other metrics of the system component can be specified as a KPI for an offline optimization study.

The [KPIs](../../../akamas-reference/construct-templates/study-template/kpis) page of the [Study template](../../../akamas-reference/construct-templates/study-template) section in the reference guide describes how to define the corresponding structure. Specifying the KPIs can be done while first defining the study or from the Akamas UI, at either study creation time or afterward (see the following figures).

<figure><img src="https://1840531935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC1d2wNp5yTa9gnHgSILG%2Fuploads%2Fgit-blob-a6d0d6e4ce7268832869f392ec7b1dea7bb9d85f%2FScreenshot%202023-01-23%20at%2014.48.40.png?alt=media" alt=""><figcaption><p>Specifying the study KPIs</p></figcaption></figure>

<figure><img src="https://1840531935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC1d2wNp5yTa9gnHgSILG%2Fuploads%2Fgit-blob-6c55824e53dd9f073302c98adfbf79d9a2916cf3%2FScreenshot%202023-01-23%20at%2014.49.42.png?alt=media" alt=""><figcaption><p>Modifying the list of KPIs for a study</p></figcaption></figure>

Once KPIs are defined, Akamas will represent the results of the optimization in the Insights section of the Akamas UI. Moreover, the corresponding suboptimal configuration associated with a specific KPI is highlighted in the Akamas UI by a textual badge "Best \<KPI name>".

Please notice that KPIs can also be re-defined after an offline optimization study has been completed as their definition does not affect the optimization process, only the evaluation of its results. See the section [Analyzing offline optimization studies](../../running-optimization-studies/analyzing-results-of-offline-optimization-studies) and the [Optimization Insights](../../running-optimization-studies/analyzing-results-of-offline-optimization-studies/optimization-insights) page.
