E2B

沙箱指标

读取一个沙箱的 CPU、内存与磁盘用量。

先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。

GET /e2b/sandboxes/{sandboxID}/metrics● 支持

E2B 官方文档 ↗

请求参数

  • sandboxIDstring必填

    path:

  • startinteger可选

    query: Unix timestamp for the start of the interval, in seconds, for which the metrics

  • endinteger可选

    query: Unix timestamp for the end of the interval, in seconds, for which the metrics

返回

200

错误按 E2B 格式返回,参见 错误码

响应

HTTP 200

Successfully returned the sandbox metrics

application/json

名称类型说明
[].timestampstringTimestamp of the metric entry
[].timestampUnixintegerTimestamp of the metric entry in Unix time (seconds since epoch)
[].cpuCountintegerNumber of CPU cores
[].cpuUsedPctnumberCPU usage percentage
[].memUsedintegerMemory used in bytes
[].memTotalintegerTotal memory in bytes
[].memCacheintegerCached memory (page cache) in bytes
[].diskUsedintegerDisk used in bytes
[].diskTotalintegerTotal disk space in bytes