> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/ci/autopilot/jobs/usage
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: context-graph
    x-group: Context graph
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network
    x-group: Network
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: sandboxes
    x-group: Sandboxes
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: ticketing
    x-group: Ticketing
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /api/v1/tenant/ci/autopilot/jobs/usage:
    get:
      tags:
        - ci
      summary: CPU and memory use of one CI job over time
      description: >-
        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.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: owner/name
          name: repository
          in: query
          required: true
          schema:
            type: string
        - description: Workflow file
          name: workflow_path
          in: query
          required: true
          schema:
            type: string
        - description: Job name as GitHub shows it
          name: job
          in: query
          required: true
          schema:
            type: string
        - description: First day, YYYY-MM-DD
          name: from
          in: query
          schema:
            type: string
        - description: Day after the last day, YYYY-MM-DD
          name: to
          in: query
          schema:
            type: string
        - description: Run column to sort by
          name: sort
          in: query
          schema:
            type: string
            enum:
              - started_at
              - memory_peak_bytes
              - cpu_p95
              - duration_seconds
              - net_in_bytes
              - net_out_bytes
              - oom_kills
        - description: desc (default) or asc
          name: order
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
        - description: Number of runs to return (default 50, max 200)
          name: limit
          in: query
          schema:
            type: integer
        - description: Runs to skip before returning results (default 0)
          name: offset
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/db.CIJobUsage'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    db.CIJobUsage:
      type: object
      required:
        - changes
        - cpu
        - disk_read
        - disk_write
        - duration
        - job
        - limit
        - measured_runs
        - memory
        - net_in
        - net_out
        - offset
        - oom_runs
        - points
        - repository
        - runner
        - runners
        - runs
        - runs_total_count
        - workflow
        - workflow_path
        - workflow_url
      properties:
        bucket_seconds:
          type: integer
          nullable: true
        changes:
          type: array
          items:
            $ref: '#/components/schemas/db.CIJobUsageChange'
        cpu:
          $ref: '#/components/schemas/db.CIJobUsageCPU'
        cpu_total_cores:
          type: number
          nullable: true
        disk_read:
          $ref: '#/components/schemas/db.CIJobUsageCounter'
        disk_write:
          $ref: '#/components/schemas/db.CIJobUsageCounter'
        duration:
          $ref: '#/components/schemas/schema.StatsRow'
        job:
          type: string
        limit:
          type: integer
        measured_runs:
          type: integer
        memory:
          $ref: '#/components/schemas/schema.StatsRow'
        memory_total_bytes:
          type: integer
          nullable: true
        net_in:
          $ref: '#/components/schemas/db.CIJobUsageCounter'
        net_out:
          $ref: '#/components/schemas/db.CIJobUsageCounter'
        offset:
          type: integer
        oom_runs:
          type: integer
        points:
          type: array
          items:
            $ref: '#/components/schemas/db.CIJobUsageRun'
        repository:
          type: string
        runner:
          type: string
        runners:
          type: array
          items:
            $ref: '#/components/schemas/db.CIJobUsageRunner'
        runs:
          type: array
          items:
            $ref: '#/components/schemas/db.CIJobUsageRun'
        runs_total_count:
          type: integer
        workflow:
          type: string
        workflow_path:
          type: string
        workflow_url:
          type: string
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    db.CIJobUsageChange:
      type: object
      required:
        - cpu_p95
        - duration_p50
        - enough_runs
        - from
        - memory_peak_p95
        - min_runs
        - oom_runs
        - runs_after
        - runs_before
        - started_at
        - to
      properties:
        cpu_p95:
          $ref: '#/components/schemas/db.CIJobUsageImpact'
        decision_id:
          type: string
          nullable: true
        decision_job:
          type: string
          nullable: true
        duration_p50:
          $ref: '#/components/schemas/db.CIJobUsageImpact'
        enough_runs:
          type: boolean
        from:
          $ref: '#/components/schemas/db.CIJobUsageRunnerSpec'
        memory_peak_p95:
          $ref: '#/components/schemas/db.CIJobUsageImpact'
        min_runs:
          type: integer
        oom_runs:
          $ref: '#/components/schemas/db.CIJobUsageImpact'
        reason:
          type: string
          nullable: true
        run_attempt:
          type: integer
          nullable: true
        run_id:
          type: integer
          nullable: true
        runs_after:
          type: integer
        runs_before:
          type: integer
        started_at:
          type: string
        to:
          $ref: '#/components/schemas/db.CIJobUsageRunnerSpec'
    db.CIJobUsageCPU:
      type: object
      required:
        - max
        - mean
        - p50
        - p90
        - p95
        - p99
      properties:
        max:
          $ref: '#/components/schemas/schema.StatsRow'
        mean:
          $ref: '#/components/schemas/schema.StatsRow'
        p50:
          $ref: '#/components/schemas/schema.StatsRow'
        p90:
          $ref: '#/components/schemas/schema.StatsRow'
        p95:
          $ref: '#/components/schemas/schema.StatsRow'
        p99:
          $ref: '#/components/schemas/schema.StatsRow'
    db.CIJobUsageCounter:
      type: object
      required:
        - stats
        - sum
      properties:
        stats:
          $ref: '#/components/schemas/schema.StatsRow'
        sum:
          type: integer
    schema.StatsRow:
      type: object
      properties:
        id:
          type: string
        last:
          type: number
        max:
          type: number
        mean:
          type: number
        min:
          type: number
        p50:
          type: number
        p90:
          type: number
        p95:
          type: number
        p99:
          type: number
        std_dev:
          type: number
        tenant_id:
          description: Tenant that owns the row. @rls:tenant
          type: string
    db.CIJobUsageRun:
      type: object
      required:
        - cpu
        - cpu_total_cores
        - disk_read_bytes
        - disk_write_bytes
        - duration_seconds
        - memory_peak_bytes
        - memory_total_bytes
        - net_in_bytes
        - net_out_bytes
        - oom_kills
        - runner
        - runner_changed
        - runs
        - started_at
      properties:
        conclusion:
          type: string
          nullable: true
        cpu:
          $ref: '#/components/schemas/schema.StatsRow'
        cpu_total_cores:
          type: number
        decision_id:
          type: string
          nullable: true
        decision_job:
          type: string
          nullable: true
        disk_read_bytes:
          type: integer
        disk_write_bytes:
          type: integer
        duration_seconds:
          type: number
        memory_peak_bytes:
          type: integer
        memory_total_bytes:
          type: integer
        memory_used_ratio:
          type: number
          nullable: true
        net_in_bytes:
          type: integer
        net_out_bytes:
          type: integer
        oom_kills:
          type: integer
        run_attempt:
          type: integer
          nullable: true
        run_id:
          type: integer
          nullable: true
        run_url:
          type: string
          nullable: true
        runner:
          type: string
        runner_changed:
          type: boolean
        runs:
          type: integer
        started_at:
          type: string
    db.CIJobUsageRunner:
      type: object
      required:
        - cpu_total_cores
        - from
        - memory_total_bytes
        - runner
        - runs
        - to
      properties:
        cpu_total_cores:
          type: number
        from:
          type: string
        memory_total_bytes:
          type: integer
        runner:
          type: string
        runs:
          type: integer
        to:
          type: string
    db.CIJobUsageImpact:
      type: object
      required:
        - outcome
      properties:
        after:
          type: number
          nullable: true
        before:
          type: number
          nullable: true
        delta:
          type: number
          nullable: true
        delta_pct:
          type: number
          nullable: true
        outcome:
          type: string
          enum:
            - better
            - worse
            - neutral
    db.CIJobUsageRunnerSpec:
      type: object
      required:
        - cpu_total_cores
        - memory_total_bytes
        - runner
      properties:
        cpu_total_cores:
          type: number
        memory_total_bytes:
          type: integer
        runner:
          type: string
  securitySchemes:
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.