CPU and memory use of one AutoPilot for CI run
The measured CPU and memory of one job from the routing history: summary is the history row with the job’s conclusion, start, end, and disk and network totals in bytes, and cpu as a share of the runner’s cores (above 1 when a job bursts past the size AutoPilot launched; mean is the average, max the peak, p50 to p99 the per-second percentiles; min, std_dev and last are not measured and stay 0), null when the job was not measured; series gives memory (GB) and CPU (cores) per 5 second bucket, each with t seconds from the start and its absolute time at, with memory_total_gb and cpu_total_cores as the runner’s size; steps gives the job’s GitHub steps once the job history has them, with start_offset_s and end_offset_s in seconds from the start and duration_s in seconds; egress gives bytes per network destination, or null with egress_missing not_available when network tracing did not run. When the job was not measured, summary.usage is null, summary.usage_missing says why and series is empty.
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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": {
"egress_missing": "",
"series": [
{
"at": "<string>",
"cpu_cores": 123,
"mem_gb": 123,
"t": 123,
"cpu_share": 123
}
],
"steps": [
{
"conclusion": "<string>",
"egress": [
{
"bytes_in": 123,
"bytes_out": 123,
"destination": "<string>",
"port": 123
}
],
"name": "<string>",
"number": 123,
"completed_at": "<string>",
"duration_s": 123,
"end_offset_s": 123,
"start_offset_s": 123,
"started_at": "<string>"
}
],
"summary": {
"baseline_estimated": true,
"cancelled": true,
"candidates": [
{
"eligible": true,
"label": "<string>",
"measured": true,
"provider": "<string>",
"reason": "<string>",
"connection": {
"id": "<string>",
"name": "<string>",
"removed": true,
"cluster": "<string>",
"cluster_id": "<string>"
},
"cost_usd": 123,
"idle": true,
"instance_type": "<string>",
"machine": {
"ram_gb": 123,
"size": "<string>",
"vcpus": 123
},
"node_price_per_hour": 123,
"node_share_per_hour": 123,
"price_per_hour": 123,
"wall_seconds": 123
}
],
"conclusion": "<string>",
"decided_at": "<string>",
"decision_id": "<string>",
"default_runner": "<string>",
"event": "<string>",
"failure": "",
"failure_provider": "<string>",
"git_keys": [
"<string>"
],
"job": "<string>",
"policy": "cheapest",
"provider": "<string>",
"reason": "<string>",
"repository": "<string>",
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>",
"runner": "<string>",
"settled": true,
"source": "settings",
"usage_missing": "",
"watch_state": "",
"workflow": "<string>",
"workflow_path": "<string>",
"actual_cost_usd": 123,
"added_usd": 123,
"added_wall_seconds": 123,
"connection": {
"id": "<string>",
"name": "<string>",
"removed": true,
"cluster": "<string>",
"cluster_id": "<string>"
},
"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>"
},
"default_cost_usd": 123,
"default_price_per_hour": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"ended_at": "<string>",
"estimated_cost_usd": 123,
"machine": {
"ram_gb": 123,
"size": "<string>",
"vcpus": 123
},
"net_in_bytes": 123,
"net_out_bytes": 123,
"pull_request": 123,
"samples": 123,
"saved_usd": 123,
"saved_wall_seconds": 123,
"sizing": {
"kind": "downsized",
"measured_runs": 123,
"need_ram_gb": 123,
"oom_floor_gb": 123
},
"started_at": "<string>",
"usage": {
"cpu_avg_cores": 123,
"cpu_p50": 123,
"cpu_p90": 123,
"cpu_p95": 123,
"cpu_p99": 123,
"cpu_peak_cores": 123,
"cpu_total_cores": 123,
"final": true,
"memory_peak_gb": 123,
"memory_total_gb": 123,
"oom_kills": 123,
"source": "sandbox",
"cpu_used_ratio": 123,
"memory_used_ratio": 123
}
},
"cpu_total_cores": 123,
"egress": [
{
"bytes_in": 123,
"bytes_out": 123,
"destination": "<string>",
"port": 123
}
],
"memory_total_gb": 123
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Was this page helpful?
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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/runs/{decision_id}/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": {
"egress_missing": "",
"series": [
{
"at": "<string>",
"cpu_cores": 123,
"mem_gb": 123,
"t": 123,
"cpu_share": 123
}
],
"steps": [
{
"conclusion": "<string>",
"egress": [
{
"bytes_in": 123,
"bytes_out": 123,
"destination": "<string>",
"port": 123
}
],
"name": "<string>",
"number": 123,
"completed_at": "<string>",
"duration_s": 123,
"end_offset_s": 123,
"start_offset_s": 123,
"started_at": "<string>"
}
],
"summary": {
"baseline_estimated": true,
"cancelled": true,
"candidates": [
{
"eligible": true,
"label": "<string>",
"measured": true,
"provider": "<string>",
"reason": "<string>",
"connection": {
"id": "<string>",
"name": "<string>",
"removed": true,
"cluster": "<string>",
"cluster_id": "<string>"
},
"cost_usd": 123,
"idle": true,
"instance_type": "<string>",
"machine": {
"ram_gb": 123,
"size": "<string>",
"vcpus": 123
},
"node_price_per_hour": 123,
"node_share_per_hour": 123,
"price_per_hour": 123,
"wall_seconds": 123
}
],
"conclusion": "<string>",
"decided_at": "<string>",
"decision_id": "<string>",
"default_runner": "<string>",
"event": "<string>",
"failure": "",
"failure_provider": "<string>",
"git_keys": [
"<string>"
],
"job": "<string>",
"policy": "cheapest",
"provider": "<string>",
"reason": "<string>",
"repository": "<string>",
"run_attempt": 123,
"run_id": 123,
"run_url": "<string>",
"runner": "<string>",
"settled": true,
"source": "settings",
"usage_missing": "",
"watch_state": "",
"workflow": "<string>",
"workflow_path": "<string>",
"actual_cost_usd": 123,
"added_usd": 123,
"added_wall_seconds": 123,
"connection": {
"id": "<string>",
"name": "<string>",
"removed": true,
"cluster": "<string>",
"cluster_id": "<string>"
},
"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>"
},
"default_cost_usd": 123,
"default_price_per_hour": 123,
"disk_read_bytes": 123,
"disk_write_bytes": 123,
"duration_seconds": 123,
"ended_at": "<string>",
"estimated_cost_usd": 123,
"machine": {
"ram_gb": 123,
"size": "<string>",
"vcpus": 123
},
"net_in_bytes": 123,
"net_out_bytes": 123,
"pull_request": 123,
"samples": 123,
"saved_usd": 123,
"saved_wall_seconds": 123,
"sizing": {
"kind": "downsized",
"measured_runs": 123,
"need_ram_gb": 123,
"oom_floor_gb": 123
},
"started_at": "<string>",
"usage": {
"cpu_avg_cores": 123,
"cpu_p50": 123,
"cpu_p90": 123,
"cpu_p95": 123,
"cpu_p99": 123,
"cpu_peak_cores": 123,
"cpu_total_cores": 123,
"final": true,
"memory_peak_gb": 123,
"memory_total_gb": 123,
"oom_kills": 123,
"source": "sandbox",
"cpu_used_ratio": 123,
"memory_used_ratio": 123
}
},
"cpu_total_cores": 123,
"egress": [
{
"bytes_in": 123,
"bytes_out": 123,
"destination": "<string>",
"port": 123
}
],
"memory_total_gb": 123
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}