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

# 数据流运行状态

> 读取每个数据流的接入状态与数据量。

```http theme={null}
GET /api/v1/streams/runtime
```

返回每个数据流的运行状态：存储的行数与字节数、最近接收时间、接入状态，以及分桶的时间序列。该调用需要 `streams.read`，系统遥测需要 `sys.telemetry.read`。

**查询参数**

| 参数 | 默认值 | 说明 |
| - | - | - |
| `window_secs` | 86400 | 窗口长度，限制在 3600 到 604800 之间。 |
| `bucket_count` | 24 | 时间序列的分桶数，限制在 6 到 48 之间。 |

```bash cURL theme={null}
curl "http://localhost:5080/api/v1/streams/runtime?window_secs=3600" \
  -H "authorization: Bearer $MS_JWT"
```

```json 200 theme={null}
{
  "generated_at_micros": 1790000000000000,
  "window_start_micros": 1789996400000000,
  "window_end_micros": 1790000000000000,
  "window_secs": 3600,
  "streams": [
    {
      "id": "3KE0ot1NtfCTJ3V3XxBNbqx9Y62",
      "name": "app",
      "stream_type": "logs",
      "status": "healthy",
      "rows": 7500,
      "stored_bytes": 153063,
      "current_stored_bytes": 153063,
      "total_rows": 7500,
      "collected_bytes": 2068890,
      "collected_bytes_complete": true,
      "index_bytes": 81282,
      "first_received_at_micros": 1789999000000000,
      "last_received_at_micros": 1789999990000000,
      "stats_available": true,
      "buckets": [
        { "start_micros": 1789996400000000, "end_micros": 1789997000000000, "rows": 0, "stored_bytes": 0 }
      ]
    }
  ]
}
```

| `status` | 含义 |
| - | - |
| `healthy` | 最近 15 分钟内有数据到达。 |
| `delayed` | 最近一条数据早于 15 分钟，但晚于 2 小时。 |
| `interrupted` | 最近一条数据早于 2 小时。 |
| `idle` | 按设计就比较安静的数据流，例如 Mole Agent 的链路数据流。 |
| `unused` | 数据流从未收到过数据。 |
| `unknown` | 统计信息不可用。 |


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