Get sandbox stats history
Get the CPU, memory and disk usage of a sandbox over time. The server keeps a sample every 3 s for 7 days and groups the samples to a step that gives at most 1,500 points. The answer also lists the periods in which the sandbox was paused, and the changes of its size that took effect, in the range. The live stream at /v1/sandboxes/{idOrName}/stats/live sends the newest samples.
Authorization
apiKey API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.
In: header
Path Parameters
Sandbox ID (ULID) or name
Query Parameters
Required when the path names the sandbox by name.
Required when the path names the sandbox by name.
Start of the range, inclusive, RFC 3339. Default: one hour before end.
date-timeEnd of the range, exclusive, RFC 3339. Default: now. The range is at most 7 days.
date-timeResponse Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X GET "https://example.com/v1/sandboxes/string/stats/history"{ "pauses": [ { "end": "2019-08-24T14:15:22Z", "start": "2019-08-24T14:15:22Z" } ], "resizes": [ { "at": "2019-08-24T14:15:22Z", "cause": "resize", "from": { "cpu": 0, "disk_bytes": 0, "memory_bytes": 0 }, "to": { "cpu": 0, "disk_bytes": 0, "memory_bytes": 0 } } ], "samples": [ { "cpu_count": 0, "cpu_used_percent": 0.1, "cpu_used_percent_max": 0.1, "disk_available_bytes": 0, "disk_used_bytes": 0, "disk_used_bytes_max": 0, "mem_available_bytes": 0, "mem_used_bytes": 0, "mem_used_bytes_max": 0, "sampled_at": "2019-08-24T14:15:22Z" } ], "step_seconds": 0}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}Stream the changes of several sandboxes GET
Stream the changes of up to 100 sandboxes as server-sent events. - Each `sandbox` event carries the sandbox exactly as `GET /v1/sandboxes/{idOrName}` returns it to the caller. - The stream sends every sandbox at once, then again each time its response changes. - A `removed` event says that the stream sends no more events for a sandbox: it reached the deleted state, or the caller can no longer read it. - Close the stream after the last `removed` event. A browser `EventSource` opens a closed stream again by itself. - A `ping` event arrives every 25 s when no other event arrives. - The caller must be able to read every sandbox when the stream opens. - The stream ends after the last `removed` event.
Stream live sandbox stats GET
Stream the CPU, memory and disk usage of a sandbox as server-sent events. The stream sends the last sample at once when it is at most 15 s old, then a new sample about every 3 s while the sandbox runs. A ping event arrives every 25 s when no sample arrives.