Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
To learn more about this project, read the wiki.

How to locally run and test KPI Value API micro-service

Pre-requisets

Ensure the following requirements are met before executing the KPI Value API service.

  1. The KPI Manger service is running and Apache Kafka is running.

  2. A virtual enviornment exist with all the required packages listed in "requirements.in" file sucessfully installed.

  3. Call the "create_all_topics()" function to verify the existence of all required topics on kafka.

Messages format templates

The "messages" python file contains templates for creating gRPC messages.

Unit test file

The "KPI Value API test" python file enlist various tests conducted to validate functionality.

Flow of execution (Kpi Maanager Service functions)

  1. Call the create_new_topic_if_not_exists(<list of string>) method to create any new topics if needed.

  2. Call StoreKpiValues(KpiValueList) to produce Kpi Value on a Kafka Topic. (The KpiValueWriter microservice will consume and process the Kpi Value)

  3. Call SelectKpiValues(KpiValueFilter) -> KpiValueList to read metric from the Prometheus DB.