# Visualisation

## How it works <a href="#how-it-works" id="how-it-works"></a>

To perform visualization, the Event Engine needs **influxDB** and **grafana** (tested on influxDB 1.1.1 and grafana 4.0.2 versions) or **Power BI**. Metrics are passed to **influxDB** by **EVE\_Core** application, and then they are visualized by **grafana**. All requests processed by **EVE\_Core** in specified time are passed to **Metric Processor**, that counts statistics and saves them in **influxDB** database. **EVE\_Core** passes a JSON request, JSON response, clientId and request type to the **Metric Processor**. In **grafana**, **influx** is defined as **DataSource**, from which metrics are downloaded. **EVE\_Core** do not connect with **grafana**.

## Configuration <a href="#configuration" id="configuration"></a>

**Influx** parameters are defined in **EVE\_Core** config file, as well as other parameters for metrics.

List of parameters:

* **metrics\_destination** - INFLUX\_DB if statistics will be sent to influx, POWER\_BI if statistics will be sent to Power BI, NONE if statistics will not be counted
* **influx\_db\_url** - url address of influx, for example: <http://127.0.0.1:8086>
* **influx\_db\_user** - user name
* **influx\_db\_password** - user password
* **influx\_db\_database** - database name
* **influx\_db\_retention\_policy** - retention policy name (retention policy describes how long InfluxDB keeps data)
* **custom\_request\_fields** - fields from an incoming event used as grouping in metrics' values aggregation
* **metric\_processed\_times** - defines how often the number of events occured will be counted
* **metric\_time\_window** - defines how often metrics will be sent to influx, defined in seconds
* **aggregate\_time\_window** - used by MeanScoreMetric, counts average value of score in given time window, defined in seconds (can't be less then metric\_time\_window)
* **max\_metric\_calculation\_threads** - maximum number of threads used to count metrics. The number of threads is set by the number of calculated metrics, but can't be bigger then maximum number of threads.
* **event\_request\_metrics** - metrics names for events of EVENT type, available metrics:
  * MeanScoreMetric
  * ProcessedRequestsMetric
  * WinPrcMetric
  * BidPrcMetric
* **profile\_request\_metrics** - metrics names for events of PROFILE type

## Available metrics <a href="#available-metrics" id="available-metrics"></a>

**Processed Requests Metric**

This metric presents the number of processed requests in specified time window (defined as **metric\_time\_window** parameter), including the number of incorrect requests and scored request. Statistics are aggregated per clientId and fields defined in **custom\_request\_fields**.

Fields in JSON send to grafana (influx name: processed\_requests, all fields are numeric):

* processed
* processed\_time\_\[number from config]
* scored
* errors
* min\_time
* max\_time
* mean\_time
* sum\_time

<figure><img src="/files/ljQdgQGzpyWoJesv0M5N" alt=""><figcaption></figcaption></figure>

**Mean Score Metric**

This metric presents mean score for every clientId and modelId and fields defined in **custom\_request\_fields**.Time window is defined in **aggregate\_time\_window**, with shift defined in **metric\_time\_window** parameter.

In programmatic, a suggested bidding price is returned instead of score.

Fields in JSON send to grafana (influx name: score, all fields except of modelId are numeric):

* min\_score
* max\_score
* mean\_score
* sum\_score
* scores\_count
* modelId (text)

<figure><img src="/files/NS4vi8b1nmXQDcv2C8Vv" alt=""><figcaption></figcaption></figure>

**WinPrcMetric\***

WinPrcMetric - price paid for a won view

Fields in JSON send to grafana (influx name: win\_prc, all fields are numeric):

* min\_win\_prc
* max\_win\_prc
* mean\_win\_prc
* sum\_win\_prc
* count\_win\_prc

**BidPrcMetric\***

BidPrcMetric - bidded price (from bid response)

Fields in JSON send to grafana (influx name: bid\_prc, all fields are numeric):

* min\_bid\_prc
* max\_bid\_prc
* mean\_bid\_prc
* sum\_bid\_prc
* count\_bid\_prc

\*(Metrics only used in programmatic)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://algolytics-technologies.gitbook.io/algolytics/event-engine-user/visualisation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
