# pub.chive.admin.getNodeMetrics

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getNodeMetrics)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getNodeMetrics/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getNodeMetrics/examples)

## Definitions

### `pub.chive.admin.getNodeMetrics`

**Type**: `query`

Get Node.js runtime metrics and process information

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `metrics` | `array` | Yes | Node.js and process metric entries |
| `processInfo` | `ref` → `#processInfo` | Yes | Process runtime information |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**

### `pub.chive.admin.getNodeMetrics#nodeMetric`

**Type**: `object`

A Node.js runtime metric

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Metric name |
| `type` | `string` | Yes | Metric type |
| `unit` | `string` | No | Unit of measurement (bytes, seconds, percent) |
| `value` | `string` | Yes | Current value (numeric string) |

### `pub.chive.admin.getNodeMetrics#processInfo`

**Type**: `object`

Node.js process runtime information

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `pid` | `integer` | Yes | Process ID |
| `rss` | `integer` | Yes | Resident set size in bytes |
| `uptime` | `integer` | Yes | Process uptime in seconds |
| `cpuUser` | `integer` | No | CPU user time in microseconds |
| `external` | `integer` | No | External memory in bytes |
| `heapUsed` | `integer` | Yes | V8 heap used in bytes |
| `cpuSystem` | `integer` | No | CPU system time in microseconds |
| `heapTotal` | `integer` | Yes | V8 heap total in bytes |
| `eventLoopLag` | `integer` | No | Event loop lag in microseconds |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getNodeMetrics",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "metrics",
            "processInfo"
          ],
          "properties": {
            "metrics": {
              "type": "array",
              "items": {
                "ref": "#nodeMetric",
                "type": "ref"
              },
              "description": "Node.js and process metric entries"
            },
            "processInfo": {
              "ref": "#processInfo",
              "type": "ref",
              "description": "Process runtime information"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {}
      },
      "description": "Get Node.js runtime metrics and process information"
    },
    "nodeMetric": {
      "type": "object",
      "required": [
        "name",
        "value",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Metric name"
        },
        "type": {
          "type": "string",
          "description": "Metric type",
          "knownValues": [
            "counter",
            "gauge",
            "histogram"
          ]
        },
        "unit": {
          "type": "string",
          "description": "Unit of measurement (bytes, seconds, percent)"
        },
        "value": {
          "type": "string",
          "description": "Current value (numeric string)"
        }
      },
      "description": "A Node.js runtime metric"
    },
    "processInfo": {
      "type": "object",
      "required": [
        "pid",
        "uptime",
        "heapUsed",
        "heapTotal",
        "rss"
      ],
      "properties": {
        "pid": {
          "type": "integer",
          "description": "Process ID"
        },
        "rss": {
          "type": "integer",
          "description": "Resident set size in bytes"
        },
        "uptime": {
          "type": "integer",
          "description": "Process uptime in seconds"
        },
        "cpuUser": {
          "type": "integer",
          "description": "CPU user time in microseconds"
        },
        "external": {
          "type": "integer",
          "description": "External memory in bytes"
        },
        "heapUsed": {
          "type": "integer",
          "description": "V8 heap used in bytes"
        },
        "cpuSystem": {
          "type": "integer",
          "description": "CPU system time in microseconds"
        },
        "heapTotal": {
          "type": "integer",
          "description": "V8 heap total in bytes"
        },
        "eventLoopLag": {
          "type": "integer",
          "description": "Event loop lag in microseconds"
        }
      },
      "description": "Node.js process runtime information"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
