---
title: "Stored data"
description: "The ClickHouse tables and views ico writes and reads, and the names it stores metrics under."
canonical_url: "https://inference-cost-optimizer.com/reference/data"
---
# Stored data

> The ClickHouse tables and views ico writes and reads, and the names it stores metrics under.

Everything lives in one ClickHouse database, `ico` by default. Raw rows expire after 30 days, in whole days; replay results are kept until you delete them.

## Tables

<table>
<thead>
  <tr>
    <th>
      Table
    </th>
    
    <th>
      Written from
    </th>
    
    <th>
      One row per
    </th>
    
    <th>
      Kept
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        requests
      </code>
    </td>
    
    <td>
      the gateways
    </td>
    
    <td>
      request the gateway proxied
    </td>
    
    <td>
      30 days
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        engine_spans
      </code>
    </td>
    
    <td>
      the engines' OpenTelemetry traces
    </td>
    
    <td>
      engine span: queue, prefill, decode and end-to-end time, token counts
    </td>
    
    <td>
      30 days
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        engine_metrics
      </code>
    </td>
    
    <td>
      each engine's <code>
        /metrics
      </code>
    </td>
    
    <td>
      scraped sample
    </td>
    
    <td>
      30 days
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        gpu_metrics
      </code>
    </td>
    
    <td>
      the GPU exporters
    </td>
    
    <td>
      scraped sample, with its telemetry level
    </td>
    
    <td>
      30 days
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replay_runs
      </code>
    </td>
    
    <td>
      <code>
        ico replay
      </code>
    </td>
    
    <td>
      replay run: replica, window, limits, budget, margin, status
    </td>
    
    <td>
      always
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replay_results
      </code>
    </td>
    
    <td>
      <code>
        ico replay
      </code>
    </td>
    
    <td>
      config tested in a run, at each stage
    </td>
    
    <td>
      always
    </td>
  </tr>
</tbody>
</table>

## Views

<table>
<thead>
  <tr>
    <th>
      View
    </th>
    
    <th>
      Gives
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        request_spans
      </code>
    </td>
    
    <td>
      Every request with its engine span, joined on trace id; <code>
        has_span
      </code>
      
       is false where the engine sent none.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        usage_by_tenant(since, until)
      </code>
    </td>
    
    <td>
      Requests, errors and tokens per replica, model and tenant.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replica_busy(since, until)
      </code>
    </td>
    
    <td>
      Per replica, the seconds with at least one request in flight, and the span of time its requests cover.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replica_phases(since, until)
      </code>
    </td>
    
    <td>
      Per replica, engine time in prefill and decode, with the tokens of the same requests.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        replica_engine(since, until)
      </code>
    </td>
    
    <td>
      Per replica, when its engine was first and last heard from, and the model it reports.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        host_gpus(since, until)
      </code>
    </td>
    
    <td>
      Per host, its GPUs, telemetry level and the window's average of each counter.
    </td>
  </tr>
</tbody>
</table>

The parameterized views are queried like functions:

```sql
SELECT * FROM host_gpus(since = '2026-10-14 00:00:00', until = '2026-10-15 00:00:00')
```

## Metric names

Engine and GPU metrics are stored under ico's own names and units, so queries and reports read the same across vLLM versions and exporters.

### GPU metrics

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Unit
    </th>
    
    <th>
      From dcgm-exporter
    </th>
    
    <th>
      From nvidia_gpu_exporter
    </th>
    
    <th>
      Level
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sm_active_ratio
      </code>
    </td>
    
    <td>
      0 to 1
    </td>
    
    <td>
      <code>
        DCGM_FI_PROF_SM_ACTIVE
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      L3
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sm_occupancy_ratio
      </code>
    </td>
    
    <td>
      0 to 1
    </td>
    
    <td>
      <code>
        DCGM_FI_PROF_SM_OCCUPANCY
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      L3
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tensor_active_ratio
      </code>
    </td>
    
    <td>
      0 to 1
    </td>
    
    <td>
      <code>
        DCGM_FI_PROF_PIPE_TENSOR_ACTIVE
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      L3
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dram_active_ratio
      </code>
    </td>
    
    <td>
      0 to 1
    </td>
    
    <td>
      <code>
        DCGM_FI_PROF_DRAM_ACTIVE
      </code>
    </td>
    
    <td>
      
    </td>
    
    <td>
      L3
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        util_ratio
      </code>
    </td>
    
    <td>
      0 to 1
    </td>
    
    <td>
      <code>
        DCGM_FI_DEV_GPU_UTIL
      </code>
    </td>
    
    <td>
      <code>
        nvidia_smi_utilization_gpu_ratio
      </code>
    </td>
    
    <td>
      L2
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        memory_used_bytes
      </code>
    </td>
    
    <td>
      bytes
    </td>
    
    <td>
      <code>
        DCGM_FI_DEV_FB_USED
      </code>
    </td>
    
    <td>
      <code>
        nvidia_smi_memory_used_bytes
      </code>
    </td>
    
    <td>
      L1
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        memory_total_bytes
      </code>
    </td>
    
    <td>
      bytes
    </td>
    
    <td>
      <code>
        DCGM_FI_DEV_FB_TOTAL
      </code>
    </td>
    
    <td>
      <code>
        nvidia_smi_memory_total_bytes
      </code>
    </td>
    
    <td>
      L1
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        power_watts
      </code>
    </td>
    
    <td>
      watts
    </td>
    
    <td>
      <code>
        DCGM_FI_DEV_POWER_USAGE
      </code>
    </td>
    
    <td>
      <code>
        nvidia_smi_power_draw_watts
      </code>
    </td>
    
    <td>
      L1
    </td>
  </tr>
</tbody>
</table>

### Engine metrics

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      What it counts
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        requests_running
      </code>
      
      , <code>
        requests_waiting
      </code>
    </td>
    
    <td>
      Requests in the engine's batch, and queued for it
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kv_cache_usage
      </code>
    </td>
    
    <td>
      Share of the KV cache in use
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        prompt_tokens_total
      </code>
      
      , <code>
        generation_tokens_total
      </code>
    </td>
    
    <td>
      Tokens processed and generated, cumulative
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        prefix_cache_queries_total
      </code>
      
      , <code>
        prefix_cache_hits_total
      </code>
    </td>
    
    <td>
      Prefix cache lookups and hits, cumulative
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        preemptions_total
      </code>
    </td>
    
    <td>
      Requests evicted to free KV cache, cumulative
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ttft_seconds
      </code>
      
      , <code>
        inter_token_latency_seconds
      </code>
      
      , <code>
        queue_time_seconds
      </code>
      
      , <code>
        prefill_time_seconds
      </code>
      
      , <code>
        decode_time_seconds
      </code>
    </td>
    
    <td>
      Histograms, stored as <code>
        _bucket
      </code>
      
      , <code>
        _sum
      </code>
      
       and <code>
        _count
      </code>
    </td>
  </tr>
</tbody>
</table>

Each maps every name vLLM has used for it, from 0.10 to 0.31.


## Sitemap

See the full [sitemap](https://inference-cost-optimizer.com/sitemap.md) for all pages.
