<!-- Generated from the function registry (sdk/src/functions) by `cd sdk && npm run gen`. Do not edit. -->

# Analytics

> **Status:** Current (generated)

Network metrics scraped from every validator, block propagation, statistics over time.

| Function | Kind | Description |
|---|---|---|
| [`analytics.metrics`](#analyticsmetrics) | read | Network metrics over the last minutes, scraped from every validator's Prometheus endpoint: throughput, latency, mempools, fees |
| [`analytics.propagation`](#analyticspropagation) | read | Block propagation between validators, from every validator's DAG feed |
| [`analytics.stats`](#analyticsstats) | read | Per-minute aggregates (commits, transactions, failures, drops, fees) for the last minutes that saw commits |

## analytics.metrics

Network metrics over the last minutes, scraped from every validator's Prometheus endpoint: throughput, latency, mempools, fees.

- **Kind:** read
- **Runs:** `GET /api/metrics` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `minutes` | integer |  | Window (1 to 60, default 15) |

**Output**

object.

**Example**

```json
{
  "name": "analytics.metrics",
  "input": {
    "minutes": 5
  }
}
```

## analytics.propagation

Block propagation between validators, from every validator's DAG feed.

- **Kind:** read
- **Runs:** `GET /api/propagation` on the gateway

**Input**

None.

**Output**

object.

**Example**

```json
{
  "name": "analytics.propagation",
  "input": {}
}
```

## analytics.stats

Per-minute aggregates (commits, transactions, failures, drops, fees) for the last minutes that saw commits.

- **Kind:** read
- **Runs:** `GET /api/stats` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `minutes` | integer |  | Window (up to 1440, default 60) |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `minute` | integer |  | Minute |
| `commits` | integer |  | Commits |
| `txs` | integer |  | Transactions |

**Example**

```json
{
  "name": "analytics.stats",
  "input": {
    "minutes": 10
  }
}
```
