# at.happyproto.fleet.getBenchmarks

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getBenchmarks)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getBenchmarks/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getBenchmarks/examples)

## Definitions

### `at.happyproto.fleet.getBenchmarks`

**Type**: `query`

Where one instance sits in its size cohort. Withheld below a cohort of 10: a percentile over fewer is not an aggregate, it is individual data with a statistic drawn over it. Admin only.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `instance` | `string` | Yes | Instance id to position within its cohort. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cohort` | `string` | No |  |
| `cohortSize` | `integer` | No |  |
| `computedAt` | `string` (datetime) | No | The rollup refreshes daily, so this can be 24 hours old. |
| `have` | `integer` | No | History available, when accruing. |
| `metrics` | `array` | Yes |  |
| `minimum` | `integer` | No | Smallest cohort a benchmark is published for. |
| `need` | `integer` | No | History required, when accruing. |
| `reason` | `string` | No |  |
| `status` | `string` | Yes | Why a figure is absent. Branch on this, never on field presence. |
| `unit` | `string` | No |  |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **Forbidden**: The caller is not a HappyProto admin.
- **Upstream**: The telemetry store could not be queried.
- **InvalidRequest**: instance is required.
- **NotFound**: No snapshots for that instance.

### `at.happyproto.fleet.getBenchmarks#metric`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `metric` | `string` | Yes |  |
| `p50` | `integer` | Yes |  |
| `percentile` | `integer` | Yes |  |
| `value` | `integer` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Where one instance sits in its size cohort. Withheld below a cohort of 10: a percentile over fewer is not an aggregate, it is individual data with a statistic drawn over it. Admin only.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto admin.",
          "name": "Forbidden"
        },
        {
          "description": "The telemetry store could not be queried.",
          "name": "Upstream"
        },
        {
          "description": "instance is required.",
          "name": "InvalidRequest"
        },
        {
          "description": "No snapshots for that instance.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cohort": {
              "type": "string"
            },
            "cohortSize": {
              "type": "integer"
            },
            "computedAt": {
              "description": "The rollup refreshes daily, so this can be 24 hours old.",
              "format": "datetime",
              "type": "string"
            },
            "have": {
              "description": "History available, when accruing.",
              "type": "integer"
            },
            "metrics": {
              "items": {
                "ref": "#metric",
                "type": "ref"
              },
              "type": "array"
            },
            "minimum": {
              "description": "Smallest cohort a benchmark is published for.",
              "type": "integer"
            },
            "need": {
              "description": "History required, when accruing.",
              "type": "integer"
            },
            "reason": {
              "knownValues": [
                "cohort"
              ],
              "type": "string"
            },
            "status": {
              "description": "Why a figure is absent. Branch on this, never on field presence.",
              "knownValues": [
                "ok",
                "accruing",
                "withheld"
              ],
              "type": "string"
            },
            "unit": {
              "knownValues": [
                "days",
                "snapshots"
              ],
              "type": "string"
            }
          },
          "required": [
            "status",
            "metrics"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "instance": {
            "description": "Instance id to position within its cohort.",
            "type": "string"
          }
        },
        "required": [
          "instance"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "metric": {
      "properties": {
        "metric": {
          "type": "string"
        },
        "p50": {
          "type": "integer"
        },
        "percentile": {
          "type": "integer"
        },
        "value": {
          "type": "integer"
        }
      },
      "required": [
        "metric",
        "value",
        "p50",
        "percentile"
      ],
      "type": "object"
    }
  },
  "id": "at.happyproto.fleet.getBenchmarks",
  "lexicon": 1
}
```
