# Metrics Overview

Experiments and Deployments on Gradient can record metrics which are available both in realtime or after they are finished running. Gradient will display these metrics in the web UI and they can also be queried or streamed in the CLI.

We log three different kinds of metrics: hardware metrics, framework metrics, and custom user metrics.

{% hint style="warning" %}
**Note:** Framework and custom metrics are only available in a Gradient [Private Cluster](/gradient/master/gradient-private-cloud/about.md). [Contact Sales](https://info.paperspace.com/contact-sales) for inquiries!
{% endhint %}

## System metrics

All Gradient workloads like Experiments and Deployments monitor and track CPU, Memory, and Network. If the machine is equipped with a GPU, this will be tracked as well.

![System Metrics showing CPU and Memory Usage](/files/-M74nn5REettgvVMIx6C)

## Framework metrics

For example, accuracy and mean squared errors are two common metrics for classification and regression, respectively.

If your deployment uses TF Serving, some metrics such as`tensorflow:core:direct_session_runs`, `tensorflow:cc:saved_model:load_attempt_count` etc. will be logged automatically.

## **Custom metrics**

You can log custom user metrics from inside of an experiment or deployment using the Python CLI utils. It's based on [Prometheus Python Client](https://github.com/prometheus/client_python). Here's a trivial example:<br>

```python
from gradient_utils.metrics import 

logger = MetricsLogger(grouping_key={'ProjectA': 'SomeLabel'})

logger.add_gauge("Gauge")
logger.add_counter("Counter")


while datetime.now() <= endAt:
    randNum = randint(1, 100)
    logger["Gauge"] = 5
    logger["Gauge"].set(randNum)
    logger["Counter"].inc()
    logger.push_metrics()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://paperspace.gitbook.io/gradient/master/metrics/metrics-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
