# View and Query Metrics

## Notebooks, Experiments & Deployment Metrics

{% tabs %}
{% tab title="Web GUI" %}

### Experiments and Jobs

You can view metrics for Jobs by entering the "Metrics" tab.  You can view metrics for Experiments by clicking on the individual Jobs that represent worker nodes. &#x20;

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-M74dnHbASLhuYBMKN1m%2F-M74nn5REettgvVMIx6C%2FScreenshot-metrics.jpg?alt=media\&token=ce8b1e6c-2bf5-4187-b8d5-1df433807b46)

### Deployments

{% hint style="warning" %}
Deployment metrics are a Gradient Private Cluster feature. [Contact Sales](https://info.paperspace.com/contact-sales) for inquiries!
{% endhint %}

To view Deployment metrics, navigate to the Metrics tab of the individual deployment.

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDRQOga6AlawVWT-ozy%2F-MDR_o8gGSDqpGg1WYqq%2Fimage.png?alt=media\&token=f9ba4c19-7116-42fb-a164-4c47a4d72f85)

### Notebooks

{% hint style="warning" %}
Notebook metrics are a Gradient Private Cluster feature. [Contact Sales](https://info.paperspace.com/contact-sales) for inquiries!
{% endhint %}

To view Notebook metrics, you will see a minimal version in the Notebook header and you can also open a more robust display with detailed information. &#x20;

![Detailed view](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDRQOga6AlawVWT-ozy%2F-MDRazRP8In-2IST3B5U%2Fimage.png?alt=media\&token=2ef8b54b-2a18-4aea-a4fc-dd1d4a8d84c7)

![Collapsed view in Notebook header](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-MDIOFDjz6ptMEEQodZJ%2F-MDIYVy_2hxA-ugivIY3%2F81246457-8a067200-8fcc-11ea-81c9-94fb4dea1eee.jpg?alt=media\&token=ac1885a0-a65f-4495-9682-1a295fbe803e)
{% endtab %}

{% tab title="CLI" %}
To query the metrics for a given workload using the CLI.  Here's an example using Experiments (the Deployments and Notebooks syntax are the same).

```
Usage: gradient experiments metrics [OPTIONS] COMMAND [ARGS]...

  Read experiment metrics

Options:
  --help  Show this message and exit.

Commands:
  get     Get experiment metrics
  stream  Watch live experiment metrics
  
```

### Get a single value for a given metric:

#### **Syntax**

```bash
gradient experiments metrics get --id <experiment id> 
```

#### **Parameters**

```bash
Usage: gradient experiments metrics get [OPTIONS]

  Get experiment metrics. Shows CPU and RAM usage by default

Options:
  --id TEXT                       ID of the experiment  [required]
  --metric [cpuPercentage|memoryUsage|gpuMemoryFree|gpuMemoryUsed|gpuPowerDraw|gpuTemp|gpuUtilization|gpuMemoryUtilization]
                                  One or more metrics that you want to read.
                                  Defaults to cpuPercentage and memoryUsage
  --interval TEXT                 Interval
  --start [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of first time series metric to
                                  collect
  --end [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of last time series metric to
                                  collect
  --apiKey TEXT                   API key to use this time only
  --optionsFile PATH              Path to YAML file with predefined options
  --createOptionsFile PATH        Generate template options file
  --help                          Show this message and exit.
  
```

#### **Example command to get CPU usage in %:**

```bash
gradient experiments metrics get --id <experiment id> --metric cpuPercentage 
```

### Stream metrics:

#### Syntax

```bash
gradient experiments metrics stream --id <experiment id>
```

#### **Parameters**

```bash
Usage: gradient experiments metrics stream [OPTIONS]

  Get experiment metrics. Shows CPU and RAM usage by default

Options:
  --id TEXT                       ID of the experiment  [required]
  --metric [cpuPercentage|memoryUsage|gpuMemoryFree|gpuMemoryUsed|gpuPowerDraw|gpuTemp|gpuUtilization|gpuMemoryUtilization]
                                  One or more metrics that you want to read.
                                  Defaults to cpuPercentage and memoryUsage
  --interval TEXT                 Interval
  --start [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of first time series metric to
                                  collect
  --end [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  Timestamp of last time series metric to
                                  collect
  --apiKey TEXT                   API key to use this time only
  --optionsFile PATH              Path to YAML file with predefined options
  --createOptionsFile PATH        Generate template options file
  --help                          Show this message and exit.
```

{% endtab %}
{% endtabs %}
