import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved \
--header 'Authorization: Bearer <token>'{
"window": "7d",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1,
"reasons": [
{
"reason": "path_filter",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"repositories": [
{
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"full_name": "<string>",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"days": [
{
"date": "2023-12-25",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"method": {
"statistic": "median",
"sample_window": 2,
"history_run_scan": 2
}
}Get the time an application's pipeline saved
The same window summary addressed by application. Each saving is estimated when the run is planned or skipped, from the stage’s own history in the same repository: the median of its newest 20 successful runs among the repository’s newest 300 concluded runs (a promoted step uses its duration in the run it was promoted from; a whole run uses the median total of the newest 20 successful runs of the same trigger). CPU-minutes are requested CPU times duration. A stage with no history is counted as unknown, never as a saving. The time is runner time, not wall-clock time. Requires pipelines.read. Read-only.
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-time-saved \
--header 'Authorization: Bearer <token>'{
"window": "7d",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1,
"reasons": [
{
"reason": "path_filter",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"repositories": [
{
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"full_name": "<string>",
"runs": 1,
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"days": [
{
"date": "2023-12-25",
"saved_seconds": 1,
"saved_cpu_minutes": 1,
"estimated_count": 1,
"unknown_count": 1
}
],
"method": {
"statistic": "median",
"sample_window": 2,
"history_run_scan": 2
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Whole UTC days ending today.
7d, 30d Response
The repository's savings over the window.
The CI time saved over a window of whole UTC days ending today.
7d, 30d Runs that recorded a saving.
x >= 0Estimated runner seconds not spent, the sum of every saving with an estimate.
x >= 0Requested CPU times duration, in CPU-minutes (one core for one minute). Null when no saving carried a CPU request.
x >= 0Savings with an estimate.
x >= 0Savings with no history to estimate from. They are never counted as time saved.
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
How every estimate in the body was made.
Show child attributes
Show child attributes