CPU and memory use of one CI job over time
Every measured run of one job (repository, workflow file and job name) that finished in the period, across the runners it ran on. points gives one entry per run in start order for the charts; when the period has more than 500 runs they are grouped into equal time buckets of bucket_seconds, runs counts the runs in each, gauges (memory, CPU, duration), disk and network are the highest run in the bucket, oom_kills the sum, and run_id, run_attempt and conclusion are those of the run with the highest memory peak. memory values are GB, CPU a share of the runner’s cores (above 1 when a job bursts past the size AutoPilot launched; mean the run’s average, max its peak, p50 to p99 its per-second percentiles), duration seconds, disk and network bytes. decision_id and decision_job name the AutoPilot history row of a run, for its run usage page, and are null when AutoPilot made no decision for it. runners lists each stretch of consecutive runs on the same runner and size, so a resize shows where it happened. memory, cpu and duration are stats across the period’s runs: memory over each run’s peak, cpu.p95 over each run’s P95 and so on, last being the latest run. net_in, net_out, disk_read and disk_write give sum, the total over the period, and stats across each run’s total. changes lists each switch to a different runner, with the runs on each side, min_runs and enough_runs saying whether both sides have enough runs to compare, and before, after, delta, delta_pct and outcome (better, worse or neutral) for memory P95, CPU P95, duration P50 and out of memory runs. runs is one page of runs, newest first unless sort and order say otherwise. Defaults to the last 30 days; usage is kept 90 days.
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"changes": [
{
"cpu_p95": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"duration_p50": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"enough_runs": true,
"from": {
"cpu_total_cores": 123,
"memory_total_bytes": 123,
"runner": "<string>"
},
"memory_peak_p95": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"min_runs": 123,
"oom_runs": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"runs_after": 123,
"runs_before": 123,
"started_at": "<string>",
"to": {
"cpu_total_cores": 123,
"memory_total_bytes": 123,
"runner": "<string>"
},
"decision_id": "<string>",
"decision_job": "<string>",
"reason": "<string>",
"run_attempt": 123,
"run_id": 123
}
],
"cpu": {
"max": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"mean": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p50": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p90": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p95": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p99": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
}
},
"disk_read": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"disk_write": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"duration": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"job": "<string>",
"limit": 123,
"measured_runs": 123,
"memory": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"net_in": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"net_out": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"offset": 123,
"oom_runs": 123,
"points": [
{
"cpu": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"cpu_total_cores": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"memory_peak_bytes": 123,
"memory_total_bytes": 123,
"net_in_bytes": 123,
"net_out_bytes": 123,
"oom_kills": 123,
"runner": "<string>",
"runner_changed": true,
"runs": 123,
"started_at": "<string>",
"conclusion": "<string>",
"decision_id": "<string>",
"decision_job": "<string>",
"memory_used_ratio": 123,
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>"
}
],
"repository": "<string>",
"runner": "<string>",
"runners": [
{
"cpu_total_cores": 123,
"from": "<string>",
"memory_total_bytes": 123,
"runner": "<string>",
"runs": 123,
"to": "<string>"
}
],
"runs": [
{
"cpu": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"cpu_total_cores": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"memory_peak_bytes": 123,
"memory_total_bytes": 123,
"net_in_bytes": 123,
"net_out_bytes": 123,
"oom_kills": 123,
"runner": "<string>",
"runner_changed": true,
"runs": 123,
"started_at": "<string>",
"conclusion": "<string>",
"decision_id": "<string>",
"decision_job": "<string>",
"memory_used_ratio": 123,
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>"
}
],
"runs_total_count": 123,
"workflow": "<string>",
"workflow_path": "<string>",
"workflow_url": "<string>",
"bucket_seconds": 123,
"cpu_total_cores": 123,
"memory_total_bytes": 123
}
}{
"message": "some message",
"status": "error"
}Query Parameters
Was this page helpful?
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/jobs/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"changes": [
{
"cpu_p95": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"duration_p50": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"enough_runs": true,
"from": {
"cpu_total_cores": 123,
"memory_total_bytes": 123,
"runner": "<string>"
},
"memory_peak_p95": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"min_runs": 123,
"oom_runs": {
"outcome": "better",
"after": 123,
"before": 123,
"delta": 123,
"delta_pct": 123
},
"runs_after": 123,
"runs_before": 123,
"started_at": "<string>",
"to": {
"cpu_total_cores": 123,
"memory_total_bytes": 123,
"runner": "<string>"
},
"decision_id": "<string>",
"decision_job": "<string>",
"reason": "<string>",
"run_attempt": 123,
"run_id": 123
}
],
"cpu": {
"max": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"mean": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p50": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p90": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p95": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"p99": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
}
},
"disk_read": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"disk_write": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"duration": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"job": "<string>",
"limit": 123,
"measured_runs": 123,
"memory": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"net_in": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"net_out": {
"stats": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"sum": 123
},
"offset": 123,
"oom_runs": 123,
"points": [
{
"cpu": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"cpu_total_cores": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"memory_peak_bytes": 123,
"memory_total_bytes": 123,
"net_in_bytes": 123,
"net_out_bytes": 123,
"oom_kills": 123,
"runner": "<string>",
"runner_changed": true,
"runs": 123,
"started_at": "<string>",
"conclusion": "<string>",
"decision_id": "<string>",
"decision_job": "<string>",
"memory_used_ratio": 123,
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>"
}
],
"repository": "<string>",
"runner": "<string>",
"runners": [
{
"cpu_total_cores": 123,
"from": "<string>",
"memory_total_bytes": 123,
"runner": "<string>",
"runs": 123,
"to": "<string>"
}
],
"runs": [
{
"cpu": {
"id": "<string>",
"last": 123,
"max": 123,
"mean": 123,
"min": 123,
"p50": 123,
"p90": 123,
"p95": 123,
"p99": 123,
"std_dev": 123,
"tenant_id": "<string>"
},
"cpu_total_cores": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"memory_peak_bytes": 123,
"memory_total_bytes": 123,
"net_in_bytes": 123,
"net_out_bytes": 123,
"oom_kills": 123,
"runner": "<string>",
"runner_changed": true,
"runs": 123,
"started_at": "<string>",
"conclusion": "<string>",
"decision_id": "<string>",
"decision_job": "<string>",
"memory_used_ratio": 123,
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>"
}
],
"runs_total_count": 123,
"workflow": "<string>",
"workflow_path": "<string>",
"workflow_url": "<string>",
"bucket_seconds": 123,
"cpu_total_cores": 123,
"memory_total_bytes": 123
}
}{
"message": "some message",
"status": "error"
}