AIOS Métricas - Cumulative Time In Polygon
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 |
|---|---|---|---|---|
|
| ID da pipeline a qual a métrica pertence | -- | Qualquer |
|
| Tipo de componente na pipeline o qual a métrica pertence | -- |
|
|
| ID do componente na pipeline o qual a métrica pertence | -- | Qualquer |
|
| Mínima timestamp na janela de tempo |
| Qualquer inteiro não-negativo |
|
| Máxima timestamp na janela de tempo |
| Qualquer inteiro não-negativo |
|
| Modo de filtro de janela de tempo |
|
|
|
| Lista de classes para filtrar |
| Qualquer lista de |
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 '{}'