eubr-bigsea/stand

LEMON: Pipeline Runs data should have endpoint returning Plotly data format

Opened this issue · 3 comments

In order to display the graphs of the execution's report in citrus, the data (GET stand/pipeline-runs) should be processed in the backend and putted in the right format to display it:

  1. Pie chart: two lists, one containing the labels and the other the frequency of each label, e.g. ['RUNNING','WAITING'...,'COMPLETED'] and [20,15,...,36].

Ps.: These two values above are the mandatory, but more graph configurations can be sent back to user, like "caipirinha/visualizations" does, e.g:

"title": "Teste com plotly",
    "data": [
        {
            "values": [
                277,
                1,
                323,
                708
            ],
            "labels": [
                "2nd",
                null,
                "1st",
                "3rd"
            ],
            "marker": {
                "colors": [
                    "#506FBB",
                    "#3FA8AD",
                    "#71AD3F",
                    "#FFCA5C"
                ]
            },
            "type": "pie",
            "hole": 0.6
        }
    ],
    "layout": {
        "title": {
            "text": "Teste"
        },
        "autosize": true,
        "height": 450
    },

Please, test the endpoint in the dev environment:

/api/v1/stand/pipeline-runs/summary?type=line
/api/v1/stand/pipeline-runs/summary?type=pie

The first one may return few results because there are only 3 jobs (others may be created during tests),
You can inform other filters, such as start and end dates (format: yyyy-mm-dd).

Please, add a granularity filter for "type=line", so the data can be grouped by hours, days, weeks, months.

@waltersf tenho duas questões referentes aos gráficos:

Atualmente, os gráficos de pizza e de série temporal das execuções estão funcionando corretamente, porém preciso de duas novas features.

  1. Como havia proposto, ainda preciso do atributo de controle do intervalo de tempo usado para agrupar as execuções no endpoint "api/v1/stand/pipeline-runs/summary?type=line", estou fazendo a chamada no front como "timeInterval=['hour','daily','weekly','monthly']". Um exemplo:

"/api/v1/stand/pipeline-runs/summary?type=line&timeInterval=hour"

Obs.: não é necessário esta adaptação no caso do gráfico de pizza.

  1. Como mostrei na última reunião, quero implementar o gŕafico de série temporal agrupando os status de cada execução, desta maneira:

image

Neste caso, preciso de um novo endpoint (por exemplo, "/api/v1/stand/pipeline-runs/summary?type=histogram") para retornar 8 valores de "y" e 1 valor de "x" (8 status que compartilham o mesmo eixo temporal, ou 8 duplas de valores "x" e "y" se for mais trivial), exemplo:

{
    'x': ['2024-09-01','2024-09-02',...'2024-09-09']
    'WAITING':{
        y: [1,0,...,6]
    },
    'COMPLETED': {
        y: [2,1,...,0]    
    },
    ...
}

Seria interessante este novo gráfico também ter o atributo de "timeInterval" para mexer na granularidade do eixo temporal.

Perceba que este é um gráfico de série temporal mais detalhado que o anterior, também mostrando as informações totais, portanto se achar desnecessário ainda termos o primeiro depois de implementar este, podemos deprecá-lo.