AIOS Métricas - Cumulative Time In Polygon

AIOS Métricas - Cumulative Time In Polygon

Screenshot 2025-07-07 125614.png
Swagger AIOS Metrics - https://metrics.dt-app.com/docs#/

GET /cumulative_time_in_polygon

Retorna o tempo que cada tracker passou no polígono

Query Params

Nome

Tipo

Descrição

Padrão

Valores Aceitos

Nome

Tipo

Descrição

Padrão

Valores Aceitos

pipeline_id

string

ID da pipeline a qual a métrica pertence

--

Qualquer string

component_name

string

Tipo de componente na pipeline o qual a métrica pertence

--

PolylineWithDirection | DetectionInPolygon | Polyline

component_id

string

ID do componente na pipeline o qual a métrica pertence

--

Qualquer string

start_timestamp

int

Mínima timestamp na janela de tempo

0

Qualquer inteiro não-negativo

end_timestamp

int

Máxima timestamp na janela de tempo

2556143999000

Qualquer inteiro não-negativo

window_time_mode

string

Modo de filtro de janela de tempo

absolute

absolute | schedule

classes

string

Lista de classes para filtrar

[] (lista vazia)

Qualquer lista de string

Body

Nenhum body requerido.

Resposta

  • Response: 200 OK

{ "result": "00:00:00", "metric_type": "literal" }
  • Exceptions:

    • 500 Internal Server Error


Exemplos

Python:

import requests url = "https://metrics.dt-app.com/cumulative_time_in_polygon" params = { "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", "component_id": "component_123", "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute", # "classes": ["vehicle", "person"] # Optional } headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" } body = {} response = requests.get(url, headers=headers, params=params, json=body) print("Status code:", response.status_code) try: print("Response JSON:", response.json()) except Exception as e: print("Error parsing JSON:", e) print("Raw response text:", response.text)

JavaScript:

const url = "https://metrics.dt-app.com/cumulative_time_in_polygon"; const params = { "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", "component_id": "component_123", "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute" // "classes": [] Optional }; const queryString = new URLSearchParams(params).toString(); const fullUrl = `${url}?${queryString}`; const headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" }; const body = {}; console.log(`Sending request to: ${fullUrl}`); fetch(fullUrl, { method: 'GET', headers: headers, body: JSON.stringify(body) }) .then(response => { console.log("Status code:", response.status); if (!response.ok) { return response.text().then(text => { throw new Error(`HTTP error! status: ${response.status}, body: ${text}`); }); } return response.json(); }) .then(data => { console.log("Response JSON:", data); }) .catch(error => { console.error("Error:", error); });

Curl

curl -X GET \ 'https://metrics.dt-app.com/cumulative_time_in_polygon?pipeline_id=PIPELINE_ID&component_name=DetectionInPolygon&component_id=COMPONENT_ID&start_timestamp=0&end_timestamp=2556143999000&window_time_mode=absolute' \ -H 'x-api-key: your-api-key-here' \ -H 'Content-Type: application/json' \ -d '{}'