Skip to content

Commit

Permalink
fix code snippet and remove note
Browse files Browse the repository at this point in the history
  • Loading branch information
0div committed Jan 24, 2025
1 parent 4450680 commit 295f4e2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions apps/web/src/app/(docs)/docs/sandbox/metrics/page.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Sandbox metrics

<Note>
Sandbox metrics is currently in beta:
1. [Reach out to us](/docs/support) with your use case to get access to the beta.
1. You'll need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks).
1. Consider [some limitations](#limitations-while-in-beta).
1. Metrics is free for all users during the beta.
</Note>

The sandbox metrics allows you to get information about the sandbox's CPU and memory usage.

## 1. Installing the beta version of the SDKs and CLI
## 1. Installation

To get sandbox metrics, you need to install the beta version of the SDKs and CLI.

### 1.1. Installing the beta version of the SDKs

<CodeGroup isTerminalCommand>
```bash {{ language: 'js' }}
npm i @e2b/code-interpreter@beta1.2.0-beta.0
Expand All @@ -27,7 +22,11 @@ pip install e2b-code-interpreter==1.2.0b0
# or use Core: https://github.com/e2b-dev/e2b
# pip install e2b==1.2.0b0
```
</CodeGroup>

### 1.2. Installing the beta version of the CLI

<CodeGroup isTerminalCommand>
```bash {{ language: 'bash' }}
npm i -g @e2b/cli@1.2.0-beta.0
```
Expand All @@ -37,6 +36,8 @@ npm i -g @e2b/cli@1.2.0-beta.0
Getting the metrics of a sandbox returns an array of timestamped metrics containing CPU and memory usage information.
The metrics are collected at the start of the sandbox, then every 2 seconds, and finally right before the sandbox is deleted.

### 2.1. Getting sandbox metrics using the SDKs

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpreter'
Expand Down Expand Up @@ -100,6 +101,8 @@ print('Sandbox metrics', metrics)
# ]
```
</CodeGroup>

### 2.2. Getting sandbox metrics using the CLI
<CodeGroup isTerminalCommand>
```bash
e2b sandbox metrics <sandbox_id> # $HighlightLine
Expand Down

0 comments on commit 295f4e2

Please sign in to comment.