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

# 查看应用状态和指标

> 用 squarecloud app status 查看一个或全部 Square Cloud 应用的 CPU、内存、磁盘和运行时长，并用 app metrics 打印过去 24 小时的数据。

`[appID]` 是可选的：参见 [CLI 如何找到你的应用](/zh/cli-reference/quickstart#cli-如何找到你的应用)。数据库请使用 [`squarecloud db status`](/zh/cli-reference/databases#squarecloud-db-status)。

## `squarecloud app status`

```bash 用法 theme={"system"}
squarecloud app status [appID] [--all] [--raw] [--json]
```

| 标志 | 说明 |
| - | - |
| `--all` | 显示所有应用而不是单个应用：应用 ID、是否在运行、CPU 和内存。 |
| `--raw` | 以 JSON 格式打印原始数值统计，而不是表格。 |

打印单个应用的应用 ID、CPU 使用率、内存、磁盘、状态和运行时长。

```bash theme={"system"}
squarecloud app status --all
# 每个应用一行。
```

```bash theme={"system"}
squarecloud app status <appID> --json
# 以 JSON 格式输出格式化后的值（例如 "0.5%" 和 "120MB"）。
```

```bash theme={"system"}
squarecloud app status <appID> --raw
# 以 JSON 格式输出相同的统计数据，数值不带格式。
```

## `squarecloud app metrics`

```bash 用法 theme={"system"}
squarecloud app metrics [appID] [--json]
```

打印应用过去 24 小时的 CPU 使用率、RAM 使用率和网络流量，每 5 分钟一个数据点、一行。只有内存为 512 MB 或以上的应用才会采集指标。

```bash theme={"system"}
squarecloud app metrics --json
# 以 JSON 格式打印原始数据点。
```

## 相关内容

| 命令 | API | JavaScript SDK | VS Code |
| - | - | - | - |
| `status` | [`GET .../status`](/zh/api-reference/endpoint/apps/status) | [`api.apps.status()`](/zh/sdks/js/managing_application) | [应用卡片](/zh/vscode-extension/features#应用) |
| `status --all` | [`GET /v2/apps/status`](/zh/api-reference/endpoint/apps/status-all) | [`api.apps.statusAll()`](/zh/sdks/js/managing_application) | 状态栏项 |
| `metrics` | [`GET .../metrics`](/zh/api-reference/endpoint/apps/metrics) | [`api.apps.metrics()`](/zh/sdks/js/managing_application) | [查看 24 小时指标](/zh/vscode-extension/features#应用) |
